void CollisionCheck(Rigidbody otherRigidbody) { if (otherRigidbody.mass > thresholdMass && otherRigidbody.velocity.sqrMagnitude > (thresholdSpeed * thresholdSpeed)) { int damage = (int)otherRigidbody.mass; destructibleMaster.CallEventDecreaseHealth(damage); } else { SelfSpeedCheck(); } }
void CheckIfHealthShouldDegenerate() { if (isHealthLow) { if (Time.time > nextDegenTime) { nextDegenTime = Time.time + degenRate; destructibleMaster.CallEventDecreaseHealth(healthLoss); } } }
public void ProcessDamage(int damage) { destructibleMaster.CallEventDecreaseHealth(damage); }