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