using System.Collections; using System.Collections.Generic; using UnityEditor.Localization.Plugins.XLIFF.V20; using UnityEngine; using UnityEngine.Animations; public class IdleOrcStateBehaviour : StateMachineBehaviour { private NPCController npc; [SerializeField] private string orcBreathSound; public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller) { npc = animator.gameObject.GetComponent<OrcNPCController>(); AudioManager.Instance.Play(npc.AudioSource, orcBreathSound); } public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { npc = animator.gameObject.GetComponent<OrcNPCController>(); AudioManager.Instance.Stop(npc.AudioSource); } }