Complete basic frying logic
This commit is contained in:
parent
ef0155632a
commit
9da447f835
19 changed files with 902 additions and 346 deletions
23
Assets/Scripts/Counters/StoveCounterVisual.cs
Normal file
23
Assets/Scripts/Counters/StoveCounterVisual.cs
Normal 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);
|
||||
}
|
||||
}
|
Reference in a new issue