Looking-Glass/Assets/scripts/PlaySoundOnAnimate.cs
2024-03-04 18:35:07 +00:00

14 lines
324 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlaySoundOnAnimate : StateMachineBehaviour
{
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
animator.gameObject.GetComponent<AudioSource>().Play();
}
}