public void Damage() { if (_shieldActive == true) { //Shield Strength if (_shieldLives == 3) { _shieldLives -= 1; healthBar.SetHealth(2); return; } if (_shieldLives == 2) { _shieldLives -= 1; healthBar.SetHealth(1); return; } if (_shieldLives == 1) { _shieldLives -= 1; healthBar.SetHealth(0); _shieldActive = false; _shield.SetActive(false); return; } } _playerAudioSource.clip = _hurtClip; _playerAudioSource.Play(); StartCoroutine(_cameraShake.CameraIsShaking()); _lives -= 1; // Enable right engine smoke if (_lives == 2) { _rightEngine.SetActive(true); } // Enabel left engine smoke if (_lives == 1) { _leftEngine.SetActive(true); } ui_Manager.UpdateLives(_lives); if (_lives < 1) { isAlive = false; _waveSpawner.OnPlayerDeath(); Destroy(this.gameObject); } }