// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); boardScript = GetComponent <BoardManager3>(); InitGame(); }
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(); }
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(); }