private void OnTriggerEnter2D(Collider2D target) { if (target.gameObject.tag == Level3Tags.LevelThreePlayer) { _player.PlayerDamaged(); } else if (target.gameObject.tag == Tags.flameBulletTag) { _main.DamageAudio(); MantisDamaged(); Destroy(target.gameObject); } }
public void PlayerDamaged() { _main.DamageAudio(); StartCoroutine(FlashWhenDamaged(0.1f)); _playerLives--; _uiManager.UpdatePlayerLivesUI(_playerLives); if (_playerLives < 1) { _main.StopLevelThreeMusic(); _main.GameOverAudio(); _uiManager.DisplayGameOverText(); Destroy(this.gameObject); _levelLoader.LoadMainMenuScene(); } }