예제 #1
0
        void HandleDamage(GameObject obj, int amount)
        {
            Damageable dam = obj.GetComponent <Damageable>();

            if (dam)
            {
                dam.ChangeHealth(-amount);
            }
            else
            {
                Debug.Log(obj.name + " was scheduled for damage calculations but doesn't have a damageable component.");
            }
        }
예제 #2
0
        void HandleDamage(GameObject obj, int amount)
        {
            Damageable dam = obj.GetComponent <Damageable>();

            if (obj.gameObject.name == "Player")
            {
                app.NotifyAnimation(AnimationMessage.TRIGGER, obj, "damage");
            }

            if (dam)
            {
                dam.ChangeHealth(-amount);
            }
            else
            {
                Debug.Log(obj.name + " was scheduled for damage calculations but doesn't have a damageable component.");
            }
        }