robot_2Generated
code_blocksInput

Description

The OnSoundEvent property is an event handler that is triggered whenever a sound event occurs within the SkinnedModelRenderer. This property allows you to define custom behavior in response to sound events associated with the skinned model.

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

// Example of subscribing to the OnSoundEvent
SkinnedModelRenderer renderer = new SkinnedModelRenderer();

// Define the method to handle the sound event
void HandleSoundEvent(Sandbox.SceneModel.SoundEvent soundEvent)
{
    // Custom logic for handling the sound event
    // For example, play a sound or log the event
}

// Subscribe to the OnSoundEvent
renderer.OnSoundEvent += HandleSoundEvent;

// To unsubscribe from the event
// renderer.OnSoundEvent -= HandleSoundEvent;