Ejemplo n.º 1
0
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     boardScript = GetComponent <BoardManager3>();
     InitGame();
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     enemies      = new List <Enemy>();
     boardScript  = GetComponent <BoardManager>();
     boardScript1 = GetComponent <BoardManager1>();
     boardScript2 = GetComponent <BoardManager2>();
     boardScript3 = GetComponent <BoardManager3>();
     InitGame();
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        // Singleton pattern (padrão singleton).
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != null)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        // Inicializa nossa lista de inimigos (fazer depois da animação do inimigo).
        enemies = new List <Enemy3>();

        boardManager = GetComponent <BoardManager3>();
        InitGame();
    }