예제 #1
0
        private void OnTriggerEnter(Collider other)
        {
            DamageDealer damage = other.gameObject.GetComponent <DamageDealer>();

            if (damage != null)
            {
                HP.ApplyChange(-damage.DamageAmount);
            }
        }
예제 #2
0
        private void OnTriggerEnter(Collider other)
        {
            DamageDealer damage = other.gameObject.GetComponent <DamageDealer>();

            if (damage != null)
            {
                HP.ApplyChange(-damage.DamageAmount);
                DamageEvent.Invoke();
            }

            if (HP.Value <= 0.0f)
            {
                DeathEvent.Invoke();
            }
        }