public void OnShipReset(InputAction.CallbackContext context) { if (isDead) { return; } isDead = true; ShipHasDied?.Invoke(isDead); StartCoroutine(HandleRespawn(0.5f)); }
public void TakeDamage(float rawDamage) { health -= Mathf.RoundToInt(rawDamage * damageMultiplier); if (health <= 0) { health = 0; isDead = true; ShipHasDied?.Invoke(isDead); StartCoroutine(HandleRespawn(respawnTime)); } ShipHealthUpdated?.Invoke(health); }