public void CancelAction(TimedAction timedAction) { if (actions.Contains(timedAction)) { actions.Remove(timedAction); } }
public TimedAction ScheduleAction(Action action, float delay, float period) { TimedAction timedAction = new TimedAction(action, delay, period); for (int i = 0; i < actions.Count; i++) { var act = actions[i]; if (act.countdown > delay) { actions.Insert(i, timedAction); return(timedAction); } } actions.Add(timedAction); return(timedAction); }