public static Timer CreateTimer(GameObject parent, float interval, Timer.TickAction tickAction, bool oneTime = false) { Timer timer = parent.AddComponent <Timer>(); timer.interval = interval; timer.OnTick += tickAction; timer.StartTimer(); timer.oneTime = oneTime; return(timer); }
public static Timer CreateInvocation(GameObject parent, float delay, Timer.TickAction action) { return(CreateTimer(parent, delay, action, true)); }