Пример #1
0
 private void Awake()
 {
     stateGamePlaying = GetComponent<StateGamePlaying>();
     stateGameWon = GetComponent<StateGameWon>();
     stateGameLost = GetComponent<StateGameLost>();
     //		stateGamePlaying.SetGameManager( this );
 }
Пример #2
0
    private void Awake()
    {
        //more singleton class stuff
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }
        DontDestroyOnLoad(this.gameObject);

        //initalize game states
        stateGamePlaying = new StateGamePlaying(this);
    }
Пример #3
0
 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);
 }
 private void Awake()
 {
     stateGamePlaying = new StateGamePlaying(this);
     stateGameWon = new StateGameWon(this);
     stateGameLost = new StateGameLost(this);
 }
Пример #5
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);
    }
 /*------------------------------------------------------------------
  * create 3 state objects - for playing / won/ lost
  */
 private void Awake()
 {
     stateGamePlaying = new StateGamePlaying(this);
     stateGameWon     = new StateGameWon(this);
     stateGameLost    = new StateGameLost(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;
    }