using UnityEngine; public class StoveBurnFlashingBarUI : MonoBehaviour { private const string IsFlashing = "IsFlashing"; [SerializeField] private StoveCounter stoveCounter; private Animator animator; private void Awake() { animator = GetComponent(); } private void Start() { stoveCounter.OnProgressChanged += StoveCounter_OnProgressChanged; animator.SetBool(IsFlashing, false); } private void StoveCounter_OnProgressChanged(object sender, IHasProgress.ProgressChangedEventArgs e) { float burnShowProgressAmount = .5f; animator.SetBool(IsFlashing, stoveCounter.IsFried() && e.ProgressNormalized >= burnShowProgressAmount); } }