IEnumerator ActiveHeal(float healPerSec) { effectInstance.SetActive(true); float startTime = Time.time; while (Time.time < startTime + duration) { health.HealAbsolut((int)healPerSec / 2); yield return(new WaitForSeconds(0.5f)); } effectInstance.SetActive(false); }