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