public void WasHit(Vector3 direction) { if (lastHitTime == 0 || Time.time - lastHitTime > invincibleTime) { print("WAS HIT!"); hearts.Show(); hearts.DropLife(); lastHitTime = Time.time; lives -= 1; } ui.UpdateLives(lives); if (lives == 0) { Die(direction); } }