예제 #1
0
 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);
     }
 }
예제 #2
0
 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();
     }
 }