// Update is called once per frame void Update() { int aux = 0; for (int i = 0; i < SpawnerList.Length; i++) { if (SpawnerList[i].allDead == true) { aux++; } } if (aux == SpawnerList.Length && FlagSpawned == false) { SpawnFlag(); FlagSpawned = true; GameObject.Destroy(GetComponent <BoxCollider>()); for (int i = 0; i < SpawnerList.Length; i++) { GameObject.Destroy(SpawnerList[i]); } MusicRef.StopBattleMusic(); StartCoroutine(DestroyDelay(1f)); } }
void GameOver() { Physics.IgnoreLayerCollision(8, 13, true); Physics.IgnoreLayerCollision(9, 13, true); Physics.IgnoreLayerCollision(10, 13, true); Physics.IgnoreLayerCollision(11, 13, true); MusicRef.StopBattleMusic(); MusicRef.StartGameOverMusic(); StartCoroutine(FadeIn(Canvas.transform.Find("BlackScreen").gameObject, 2f, 1f)); StartCoroutine(PanelDelay(2f, "GameOverPanel")); isGameOver = true; }