Example #1
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
     stateGameIntro = new StateGameIntro(this);
     stateGameMenu  = new StateGameMenu(this);
     stateGamePlay  = new StateGamePlay(this);
     stateGameLose  = new StateGameLose(this);
 }
    void Awake()
    {
        if (m_instance != null && m_instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            m_instance = this;
        }
        DontDestroyOnLoad(this.gameObject);

        m_stateGamePlay  = new StateGamePlay(this);
        m_stateGameWon   = new StateGameWon(this);
        m_stateGameLost  = new StateGameLost(this);
        m_stateGameIntro = new StateGameIntro(this);
        m_stateGameMenu  = new StateGameMenu(this);
    }