Пример #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);
 }
Пример #2
0
    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);
    }
Пример #3
0
    private void Awake()
    {
        DontDestroyOnLoad(this.gameObject);
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        stateGameIntro = new StateGameIntro(this);
        stateGameMenu = new StateGameMenu(this);
        stateGamePlaying = new StateGamePlaying(this);
        stateGameWon = new StateGameWon(this);
        stateGameLost = new StateGameLost(this);
    }