示例#1
0
 void Start()
 {
     if (instatnce == null)
     {
         instatnce = this;
     }
     homeState.gameObjectsInThisState                  = gameObjectsInHomeState;
     selectLevelState.gameObjectsInThisState           = gameObjectsSelectLevelState;
     selectNumberOfPlayersState.gameObjectsInThisState = gameObjectsSelectNumberOfPlayersState;
     currentState = homeState;
     currentState.enterState();
 }
示例#2
0
 public void changeState(menuState newState)
 {
     currentState.exitState();
     newState.enterState();
     currentState = newState;
 }