void OnTriggerEnter(Collider other) { if (onAttack) { if ((m_colliderMask.value & 1 << other.gameObject.layer) == 1 << other.gameObject.layer) { if (other.CompareTag("BossCocoon")) { BossCocoon cocoon = other.GetComponent <BossCocoon>(); m_boss.Heal(cocoon.LifeLeach(m_leachAmount * 10)); } else { LivingEntity entity = other.GetComponent <LivingEntity>(); entity.TakeDirectDamage(m_leachAmount); m_boss.Heal(entity.LastDamage); } } } }
public void UpdateState(LivingEntity entity) { if (healthBar) healthBar.UpdateProgress(entity.m_entity.health, entity.m_entity.maxHealth); if (energyBar) energyBar.UpdateProgress(entity.m_entity.armor, entity.m_entity.maxArmor); }
void Awake() { objectCollider = GetComponent<SphereCollider>(); objectCollider.isTrigger = true; entity = GetComponent<LivingEntity>(); }
void Awake() { objectCollider = GetComponent <SphereCollider>(); objectCollider.isTrigger = true; entity = GetComponent <LivingEntity>(); }