using UnityEngine; public static class GameFlowState { public static string ModeKey { get; private set; } = ""; public static int Level { get; private set; } public static bool ReturningToLobby { get; private set; } [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] static void ResetStatics() { ModeKey = ""; Level = 0; ReturningToLobby = false; } public static void PrepareLaunch(string modeKey, int level) { ModeKey = modeKey; Level = Mathf.Clamp(level, 1, GameDefinitions.MaxLevel); ReturningToLobby = false; } public static void MarkReturningToLobby() { ReturningToLobby = true; } public static bool ConsumeReturningToLobby() { bool value = ReturningToLobby; ReturningToLobby = false; return value; } }