public IEnumerator HealCoroutine(OutOfCombatHeal healInfo, EntityController entity) { while (true) { if ((Time.time > healInfo.TimeSinceLastAttack) && (entity.GetHealth() < entity.GetMaxHealth()) && (Time.time - entity.GetLastTimeAttacked() > healInfo.TimeSinceLastAttack)) { entity.AddHealth(healInfo.HealAmount); } yield return(new WaitForSeconds(healInfo.TimeBetweenHealTicks)); } }
public OutOfCombatHeal(OutOfCombatHeal buff) : base(buff) { TimeSinceLastAttack = buff.TimeSinceLastAttack; HealAmount = buff.HealAmount; TimeBetweenHealTicks = buff.TimeBetweenHealTicks; }
public void Heal(OutOfCombatHeal healInfo, EntityController entity) { StartCoroutine(HealCoroutine(healInfo, entity)); }