コード例 #1
0
        void collisionCheck(Rigidbody otherRigidBody)
        {
            if (otherRigidBody.mass > thresholdMass && otherRigidBody.velocity.sqrMagnitude > thresholdSpeed * thresholdSpeed)
            {
                int damage = (int)otherRigidBody.mass;
                destructibleManagerMasterScript.callDeductHealthEvent(damage);
            }

            else
            {
                selfSpeedCheck();
            }
        }
コード例 #2
0
 void Update()
 {
     if (Time.time > nextDegenTime && Time.timeScale > 0 && isHealthLow)
     {
         nextDegenTime = Time.time + degenRate;
         destructibleManagerMasterScript.callDeductHealthEvent(healthLoss);
     }
 }
 public void damageProcess(int damage)
 {
     destructibleManagerMasterScript.callDeductHealthEvent(damage);
 }