r2mods/ilspy_dump/ror2_csproj/RoR2.Mecanim/PlaySoundOnEnter.cs

23 lines
591 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2.Mecanim;
public class PlaySoundOnEnter : StateMachineBehaviour
{
public string soundString;
public string stopSoundString;
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
base.OnStateEnter(animator, stateInfo, layerIndex);
Util.PlaySound(soundString, animator.gameObject);
}
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
base.OnStateEnter(animator, stateInfo, layerIndex);
Util.PlaySound(stopSoundString, animator.gameObject);
}
}