System.Action<Sandbox.SceneModel/GenericEvent> OnGenericEvent { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OnGenericEvent property of the SkinnedModelRenderer class is an event handler that is triggered when a generic animation event occurs. This property is of type System.Action<Sandbox.SceneModel/GenericEvent>, allowing you to define a method that will be called whenever a generic event is fired during the animation of a skinned model.

Usage

To use the OnGenericEvent property, you need to assign a method that matches the signature of System.Action<Sandbox.SceneModel/GenericEvent>. This method will be invoked whenever a generic animation event is triggered. This is useful for handling custom animation events that are not covered by specific event types like footstep or sound events.

Example

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

// Define the event handler
renderer.OnGenericEvent = (genericEvent) =>
{
    // Handle the generic event
    Console.WriteLine($"Generic event triggered: {genericEvent.Name}");
};