private void ChangeState() { if (!currentStateID.Equals(AState.EGameState.NULL)) { if (m_currentState.IsDestroyable()) { m_currentState.AFDestroy(); if (m_currentState is AState) { Destroy((m_currentState as AState).gameObject); } } else { m_currentState.Pause(); } } currentStateID = m_nextStateID; m_currentState = GetState(m_nextStateID); m_nextStateID = AState.EGameState.NULL; if (m_currentState is AState) { (m_currentState as AState).transform.parent = gameObject.transform; } m_currentState.Initialize(); m_transition.End(); }
virtual public void GotoState(AState.EGameState newStateID) { m_transition.Begin(); if (newStateID == currentStateID) { return; } m_nextStateID = newStateID; }
public IState CreateStateByID(AState.EGameState newstateID) { switch (newstateID) { case AState.EGameState.GAME: return(AFObject.Create <MarioGameState>()); } return(null); }
public IState CreateStateByID(AState.EGameState newStateID) { switch (newStateID) { case AState.EGameState.MENU: return(AFObject.Create <MenuState>()); case AState.EGameState.GAME: return(AFObject.Create <GameState>()); } return(null); }
public IState CreateStateByID(AState.EGameState newStateID) { switch (newStateID) { case AState.EGameState.MENU: StartState loginS = AFObject.Create <StartState>(); loginS.SetStateID(AState.EGameState.MENU); return(loginS); } return(null); }
public IState CreateStateByID(AState.EGameState newstateID) { switch (newstateID) { case AState.EGameState.MENU: return(null); case AState.EGameState.GAME: return(null); } return(null); }
public IState CreateStateByID(AState.EGameState newstateID) { switch (newstateID) { case AState.EGameState.MENU: return(AFObject.Create <BateMenuState>()); case AState.EGameState.SELECTION: return(AFObject.Create <BateSelectionState>()); case AState.EGameState.GAME: return(AFObject.Create <BateGameState>()); } return(null); }
virtual public IState GetState(AState.EGameState newStateID) { return(m_factory.CreateStateByID(newStateID)); }
virtual public void GotoState(AState.EGameState newStateID) { m_transition.Begin(); GotoState(m_factory.CreateStateByID(newStateID)); }