public void UpdateEnemiesRemaining() { enemiesRemaining--; enemiesRemainingText.text = enemiesRemaining.ToString(); if (enemiesRemaining <= 0) { if (disablePlayeronWin) { player.DisablePlayer(); } win.levelClear = true; win.EnablewinUI(); } }
void OnTriggerEnter2D(Collider2D other) { Player player = other.gameObject.GetComponent <Player>(); if (player) { //AudioSource.PlayClipAtPoint(levelExitSFX, Camera.main.transform.position); gameSession = FindObjectOfType <GameSession>(); gameSession.GameWon(); timer = FindObjectOfType <Timer>(); timer.StopTimer(); AudioSource.PlayClipAtPoint(levelExitSFX, Camera.main.transform.position, levelEndVolume); player = FindObjectOfType <Player>(); player.DisablePlayer(); levelEndSplurt.Play(); win = FindObjectOfType <Win>(); win.EnablewinUI(); } return; }