public void Damage() { if (_shieldActive == true) { _shieldActive = false; _shieldPrefab.SetActive(false); return; } else if (_shieldActive == false) { _lives = _lives - 1; _uiManager.UpdateLives(_lives); } if (_lives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } if (_lives == 2) { _rightEnginePrefab.SetActive(true); } else if (_lives == 1) { _leftEnginePrefab.SetActive(true); } }
public void Damage() { if (_isShieldActive == true) { _isShieldActive = false; _shieldVisualizer.SetActive(false); return; } _lives -= 1; if (_lives == 2) { _leftEngine.SetActive(true); } else if (_lives == 1) { _rightEngine.SetActive(true); } _uiManager.UpdateLives(_lives); if (_lives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { _lives--; _uiManager.UpdateLives(_lives); if (_lives <= 0) { _spawnmanager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { lives -= 1; if (lives < 1) { // find game object and get component spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { StartCoroutine(PlayerHitFlash()); //Equal to _lives = _lives - 1; _lives -= 1; _uiManager.UpdateLives(_lives); if (_lives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { if (_isShieldBoostActive) { _shieldVisualiser.SetActive(false); _isShieldBoostActive = false; return; } _lives--; _uiManager.UpdateLives(_lives); if (_lives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { if (_shieldActive == true) { _shieldActive = false; _shield.SetActive(false); return; } _lives -= 1; _uiManager.UpdateLives(_lives); if (_lives < 1) { _spawn_Manager.OnPlayerDeath(); Instantiate(_explosionPref, transform.position, Quaternion.identity); Destroy(this.gameObject); } }
public void PlayerDamage() { if (_isShieldsActive == true) { _isShieldsActive = false; _sheildVisualizer.SetActive(false); return; } _playerLives -= 1; DamageRandomEngine(); _uiManager.UpdateLives(_playerLives); if (_playerLives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }
public void Damage() { if (_shieldActive == true) { _shieldActive = false; playerShield.SetActive(false); return; } _lives--; Debug.Log("Current Lives: " + _lives); _uiManager.UpdateLives(_lives); ActiveDamage(); if (_lives < 1) { _spawnManager.OnPlayerDeath(); Destroy(this.gameObject); } }