public void AddActionInTime(int inTime, System.Action action) { if (_timer.TimeLeftInSec < inTime) { throw new ArgumentOutOfRangeException(); } var newItem = new ActionScheduleItem(action, inTime); _actions.Add(newItem); }
public void AddActionAtTime(int atTime, System.Action action) { if (_timer.TimePassedInSec >= atTime) { throw new ArgumentOutOfRangeException(); } if (_timer.TimeGeneral < atTime) { throw new ArgumentOutOfRangeException(); } var newItem = new ActionScheduleItem(action, atTime - _timer.TimePassedInSec); _actions.Add(newItem); }