void TakeDamage() { if (invulnerable) { return; } lives--; if (lives <= 0) { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } HeartsUI.RemoveHeart(); StartCoroutine(Invulnerability(1)); }
public void TakeDamage() { if (invulnerable) { return; } audioSource.PlayOneShot(hitsound); lives--; HeartsUI.RemoveHeart(); if (lives <= 0) { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } StartCoroutine(Invulnerability(1)); }