namespace Sandbox;
public sealed partial class SkinnedModelRenderer
{
///
/// Called when a footstep event happens
///
public Action OnFootstepEvent { get; set; }
private void InternalOnFootstep( SceneModel.FootstepEvent e )
{
OnFootstepEvent?.Invoke( e );
}
///
/// Called when a generic animation event happens
///
public Action OnGenericEvent { get; set; }
private void InternalOnGenericEvent( SceneModel.GenericEvent ev )
{
if ( OnGenericEvent is not null )
{
OnGenericEvent.Invoke( ev );
}
}
///
/// Called when a sound event happens
///
public Action 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 );
}
///
/// Called when an anim tag event happens
///
public Action OnAnimTagEvent { get; set; }
private void InternalOnAnimTagEvent( SceneModel.AnimTagEvent ev )
{
if ( OnAnimTagEvent is not null )
{
OnAnimTagEvent.Invoke( ev );
}
}
}