void Awake() { if (instancia == null) { instancia = this; DontDestroyOnLoad(gameObject); } else { if (instancia != this) { Destroy(gameObject); } } enemigosGO = GameObject.FindGameObjectsWithTag("Enemigo"); for(int i = 0; i < enemigosGO.Length; i++) { enemigos[i] = enemigosGO[i].GetComponent<Enemigo>(); } }
void Awake() { if (instancia == null) { instancia = this; DontDestroyOnLoad(gameObject); } else { if (instancia != this) { Destroy(gameObject); } } enemigosGO = GameObject.FindGameObjectsWithTag("Enemigo"); for (int i = 0; i < enemigosGO.Length; i++) { enemigos[i] = enemigosGO[i].GetComponent <Enemigo>(); } }