void OnTriggerEnter(Collider other) { if (other.GetComponent <Rigidbody>() != null) { rigidbodyStrikingMe = other.GetComponent <Rigidbody>(); if ((rigidbodyStrikingMe.mass >= massRequirement) && (rigidbodyStrikingMe.velocity.sqrMagnitude > speedRequirement * speedRequirement)) { damageToApply = (int)(damageFactor * rigidbodyStrikingMe.mass * rigidbodyStrikingMe.velocity.magnitude); enemyMaster.CallEventEnemyDeductHealth(damageToApply); } } }
public void ProcessDamage(int damage) { int damageToApply = damage * damageMultiplier; enemyMaster.CallEventEnemyDeductHealth(damageToApply); }