public void AddEffect(StatusEffect statusEffect) { StatusEffectUIIcon temp = Instantiate(prefab, transform); temp.SetEffect(statusEffect); icons.Add(temp); }
public void RemoveEffect(StatusEffect statusEffect) { StatusEffectUIIcon toRemove = null; foreach (StatusEffectUIIcon icon in icons) { if (icon.effect == statusEffect) { toRemove = icon; break; } } icons.Remove(toRemove); Destroy(toRemove.gameObject); }