Looking-Glass/Assets/scripts/PlaySoundOnAnimate.cs

14 lines
324 B
C#
Raw Permalink Normal View History

2024-03-04 19:35:07 +01:00
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();
}
}