using System; using UnityEngine; public class ContainerCounterVisual : MonoBehaviour { [SerializeField] private ContainerCounter containerCounter; private Animator animator; private static readonly int openClose = Animator.StringToHash("OpenClose"); private void Awake() { animator = GetComponent(); } private void Start() { containerCounter.OnPlayerGrabbedObject += ContainerCounbter_OnPlayerGrabbedObject; } private void ContainerCounbter_OnPlayerGrabbedObject(object sender, EventArgs e) { animator.SetTrigger(openClose); } }