using PashaBibko.Pacore.Attributes; using UnityEngine; namespace Fruitomation { public enum GameState { Simulation, Building, UpgradeMenu, Paused, None } [CreateInstanceOnStart] public class GameStateController : MonoBehaviour { private static GameStateController Instance; private GameState InternalState = GameState.None; public static GameState State { get => Instance.InternalState; set { Debug.Log($"Changing state from [{Instance.InternalState}] to [{value}]"); Instance.InternalState = value; } } private void Awake() { if (Instance is not null) { Debug.LogError($"Cannot have multiple instances of [GameStateController]"); return; } Instance = this; } } }