void DangerEffect(Danger danger) { health.Hurt(danger.DamageOnTouch); hurt = true; if (GetComponent <Rigidbody2D>().velocity.y < 0.5f) { Disable(0.3f); GetComponent <Rigidbody2D>().AddRelativeForce(-100 * Vector2.right); } }
void DangerEffect(Danger danger) { if (dead) { return; } health.Hurt(danger.DamageOnTouch); hurt = true; }