private void LoseHealth(int damage) { if (!invincible) { vCam.ScreenShake(); SoundManager.instance.PlaySingle(enemyHurt); invincible = true; Invoke(nameof(StopInvincible), invincibilityTime); health -= damage; if (!CheckIfDead()) { _ = Instantiate(hurtParticles, transform.position, Quaternion.identity); } } }
public void PowerUp() { vCam.ScreenShake(); controls.Gameplay.Disable(); rb.velocity = Vector2.zero; rb.gravityScale = 0; savedGame.Play(); Invoke(nameof(ResetGravity), 2f); }