public void ExecuteAction(Entity target) { // When trap is triggered change status of player to poisoned. Define poison behavior elsewhere? AdjustHealthOverTime aHOT = target.gameObject.AddComponent <AdjustHealthOverTime>(); aHOT.Duration = duration; aHOT.TickRate = tickRate; aHOT.ValuePerTick = dmgPerTick; }
public void ExecuteAction(List <Entity> targets) { foreach (Entity e in targets) { AdjustHealthOverTime aHOT = e.gameObject.AddComponent <AdjustHealthOverTime> (); aHOT.Duration = duration; aHOT.TickRate = tickRate; aHOT.ValuePerTick = hPerTick; } }