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(); }
// 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(); }
// 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(); }
/// <summary> /// Sets up the stage for the NEXT gameplay state, note that this is only relevant for the SERVER /// </summary> /// <param name="type"></param> public void SetNextGameplayState( GameplayStateType type ) { m_NextStateType = type; }
/// <summary> /// Tells owner to change states on next update cycle /// </summary> protected void AnnounceNextState(GameplayStateType stateType) { m_Owner.SetNextGameplayState(stateType); }
/// <summary> /// Sets up the stage for the NEXT gameplay state, note that this is only relevant for the SERVER /// </summary> /// <param name="type"></param> public void SetNextGameplayState(GameplayStateType type) { m_NextStateType = type; }