using UnityEngine; public class AnimationBoolEvent : MonoBehaviour { [Tooltip("If you won't declare the animator don't worry because it will automatically get as the animator the animator that this script is attached to.")] [SerializeField] private Animator _animator; [SerializeField] private string _boolName; public bool StartAtPlay; private void Start() { if (_animator == null) { _animator = GetComponent(); } if (StartAtPlay) { SetBoolTrue(); } } public void SetBoolTrue() { _animator.SetBool(_boolName, true); } public void SetBoolFalse() { _animator.SetBool(_boolName, false); } public void SetPlayerAnimator() { _animator = PlayerManager.GetInstance()._PlayerMovement._CharacterAnimator; } }