// Use this for initialization void Start() { m_splashstate = AddObject <StateSplash>(m_getObject); m_loginmenu = AddObject <StateLoginMenu>(m_getObject); m_mainmenu = AddObject <StateMainMenu>(m_getObject); m_gameplay = AddObject <StateGameplay>(m_getObject); ChangeState(m_splashstate); Debug.Log("Game Start"); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return;; } else { instance = this; } DontDestroyOnLoad(this.gameObject); stateGamePlaying = new StateGamePlaying(this); stateGameWon = new StateGameWon(this); stateGameLost = new StateGameLost(this); stateMainMenu = new StateMainMenu(this); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); //initializing states stateGamePlaying = new StateGamePlaying(this); stateGameOver = new StateGameOver(this); stateIntro = new StateIntro(this); stateMainMenu = new StateMainMenu(this); //initial level currentLevelNumber = 1; }