using TMPro; using UnityEngine; public class GardenerVisibilityDetection : MonoBehaviour { public GardenerAudioController gardenerAudioController; private Animator _animator; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { _animator = GetComponent(); } private void OnBecameVisible() { gardenerAudioController.PlayGardenerVOClip(_animator.GetBool("IsScared?")); } }