Ejemplo n.º 1
0
        private void OnTriggerEnter(Collider other)
        {
            DamageDealer damage = other.gameObject.GetComponent <DamageDealer>();

            if (damage != null)
            {
                HP.ApplyChange(-damage.DamageAmount);
            }
        }
Ejemplo n.º 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();
            }
        }