A small component that plays a SoundEvent once. Guards on a Played flag so repeated calls to Play do nothing.
public class PlayOnce : Component {
[Property] public bool Played {get; set;}
[Property] public SoundEvent Event {get; set;}
[Button] public void Play() {
if (Played)
return;
Played = true;
Sound.Play(Event);
}
}