void ChangeGameState(EGamestate type) { fsm.State.Deactivate(); fsm.ChangeState(type); fsm.State.Activate(); Bootstrap.currentState = fsm.State; }
public GameState(EGamestate type, bool isRestarting, EGamestate[] additionalScreens, params MonoBehaviour[] systems) { Systems = systems.Select(x => x as IGameSystem).ToArray(); StatesIncludingSubstates = new GameState[] { this }; AdditionalScreens = additionalScreens; this.isRestarting = isRestarting; Type = type; Setup(); }
public static void OpenScreen(EGamestate type) { foreach (var screen in stateScreens.Values) { screen.Close(); } if (stateScreens.ContainsKey(type)) { stateScreens[type].Open(); background.gameObject.SetActive(stateScreens[type].UseBackground); ChangeBackground(stateScreens[type].BackgroundSprite, stateScreens[type].BackgroundColor); } }
public static void ChangeGameState(EGamestate type) { lastState = GetCurrentGamestate(); OnStateChangedEvent?.Invoke(type); }
public static UIScreen GetUIScreen(EGamestate type) { return(stateScreens[type]); }
public static void CloseScreen(EGamestate type) { stateScreens[type].Close(); }
public static void OpenScreenAdditionaly(EGamestate type) { stateScreens[type].Open(); }