Example #1
0
    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);
    }
Example #2
0
 public static Timer CreateInvocation(GameObject parent, float delay, Timer.TickAction action)
 {
     return(CreateTimer(parent, delay, action, true));
 }