mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-16 02:09:20 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
61 lines
1.3 KiB
C#
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 );
|
|
}
|
|
}
|
|
}
|