Description
The OnSoundEvent
property is an event handler that is triggered whenever a sound event occurs within the SceneModel
. This property allows you to define custom behavior in response to sound events, such as playing a specific sound, logging the event, or triggering other game logic.
Usage
To use the OnSoundEvent
property, assign a method that matches the System.Action<Sandbox.SceneModel.SoundEvent>
delegate signature. This method will be called whenever a sound event is triggered.
Example usage:
SceneModel mySceneModel = new SceneModel();
mySceneModel.OnSoundEvent = (soundEvent) => {
// Handle the sound event
// For example, play a sound or log the event
PlaySound(soundEvent);
};
Example
SceneModel mySceneModel = new SceneModel();
mySceneModel.OnSoundEvent = (soundEvent) => {
// Handle the sound event
// For example, play a sound or log the event
PlaySound(soundEvent);
};