예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        public void ProcessDamage(int damage)
        {
            int damageToApply = damage * damageMultiplier;

            enemyMaster.CallEventEnemyDeductHealth(damageToApply);
        }