Complete basic frying logic

This commit is contained in:
BuyMyMojo 2023-03-02 04:34:08 +11:00
parent ef0155632a
commit 9da447f835
19 changed files with 902 additions and 346 deletions

View file

@ -0,0 +1,23 @@
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);
}
}