Beispiel #1
0
    public void SetGameplayState(int newState, double stateStartTime)
    {
        GameplayStateType NewState = (GameplayStateType)newState;

        switch (NewState)
        {
        case GameplayStateType.waiting:
            m_CurrentState = new GameplayState_waiting(this, stateStartTime);
            break;

        case GameplayStateType.countdown:
            m_CurrentState = new GameplayState_countdown(this, stateStartTime);
            break;

        case GameplayStateType.battle:
            m_CurrentState = new GameplayState_battle(this, stateStartTime);
            break;

        case GameplayStateType.ending:
            m_CurrentState = new GameplayState_ending(this, stateStartTime);
            break;

        default:
            break;
        }

        m_CurrentState.Init();
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        // Initialise base state
        CurrentStateType = GameplayStateType.waiting;
        m_NextStateType  = GameplayStateType.waiting;

        m_CurrentState = new GameplayState_waiting(this, PhotonNetwork.time);
        m_CurrentState.Init();
    }