17 lines
635 B
C#
17 lines
635 B
C#
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, StateChangedEventArgs e) {
|
|
bool showVisual = e.State is StoveCounter.State.Frying or StoveCounter.State.Fried;
|
|
stoveOnGameObject.SetActive(showVisual);
|
|
particlesGameObject.SetActive(showVisual);
|
|
}
|
|
} |