Files
sbox-public/engine/Sandbox.Engine/Scene/Components/Render/SkinnedModelRenderer.Events.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

61 lines
1.3 KiB
C#

namespace Sandbox;
public sealed partial class SkinnedModelRenderer
{
/// <summary>
/// Called when a footstep event happens
/// </summary>
public Action<SceneModel.FootstepEvent> OnFootstepEvent { get; set; }
private void InternalOnFootstep( SceneModel.FootstepEvent e )
{
OnFootstepEvent?.Invoke( e );
}
/// <summary>
/// Called when a generic animation event happens
/// </summary>
public Action<SceneModel.GenericEvent> OnGenericEvent { get; set; }
private void InternalOnGenericEvent( SceneModel.GenericEvent ev )
{
if ( OnGenericEvent is not null )
{
OnGenericEvent.Invoke( ev );
}
}
/// <summary>
/// Called when a sound event happens
/// </summary>
public Action<SceneModel.SoundEvent> OnSoundEvent { get; set; }
private void InternalOnSoundEvent( SceneModel.SoundEvent ev )
{
if ( OnSoundEvent is not null )
{
OnSoundEvent.Invoke( ev );
}
// todo - option to disable sounds
// todo - this sound handle should follow the entity
// scene sound manager system?
Sound.Play( ev.Name, ev.Position );
}
/// <summary>
/// Called when an anim tag event happens
/// </summary>
public Action<SceneModel.AnimTagEvent> OnAnimTagEvent { get; set; }
private void InternalOnAnimTagEvent( SceneModel.AnimTagEvent ev )
{
if ( OnAnimTagEvent is not null )
{
OnAnimTagEvent.Invoke( ev );
}
}
}