This repository has been archived on 2025-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mojo-kitchen-chaos/Assets/Scripts/Counters/StoveCounterVisual.cs

23 lines
735 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StoveCounterVisual : MonoBehaviour
{
[SerializeField] private StoveCounter stoveCounter;
[SerializeField] private GameObject stoveOnGameObject;
[SerializeField] private GameObject particlesGameObject;
private void Start()
{
stoveCounter.OnStateChanged += StoveCounter_OnStateChanged;
}
private void StoveCounter_OnStateChanged(object sender, StoveCounter.OnStateChangedEventArgs e)
{
bool showVisual = e.state == StoveCounter.State.Frying || e.state == StoveCounter.State.Fried;
stoveOnGameObject.SetActive(showVisual);
particlesGameObject.SetActive(showVisual);
}
}