// Use this for initialization void Start() { FSM = new StateMachine(this); GameStateManager.Instance().FSM = FSM; FSM.ChangeState(GameStateMenu.Instance()); // FSM.GlobalState = GameGlobalState.Instance (); // FSM.GlobalState.Enter (FSM.Owner); CursorManager.SetCursor(CursorManager.CursorState.DEFAULT); }
public static GameStateMenu Instance() { if (null == m_instance) { lock (m_lockHelper) { if (null == m_instance) { m_instance = new GameStateMenu(); } } } return(m_instance); }
public static Dictionary <State, GameState> CreateStates() { // Create basic states for the game. Dictionary <State, GameState> stateList = new Dictionary <State, GameState> (); GameStateMenu menuState = new GameStateMenu(); GameStatePlay playState = new GameStatePlay(); GameStateResult resultState = new GameStateResult(); GameStateHighScore highScoreState = new GameStateHighScore(); GameStateHighScoreInput highScoreInput = new GameStateHighScoreInput(); stateList.Add(menuState.GetStateType(), menuState); stateList.Add(playState.GetStateType(), playState); stateList.Add(resultState.GetStateType(), resultState); stateList.Add(highScoreInput.GetStateType(), highScoreInput); stateList.Add(highScoreState.GetStateType(), highScoreState); return(stateList); }