Exemple #1
0
 private void Awake()
 {
     stateGamePlaying = GetComponent<StateGamePlaying>();
     stateGameWon = GetComponent<StateGameWon>();
     stateGameLost = GetComponent<StateGameLost>();
     //		stateGamePlaying.SetGameManager( this );
 }
Exemple #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);
    }
 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);
 }
    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;
    }