Overview | Videos | Documentation | Demos | Integrations | API | Support

Doc Home > Component Communication > Scheduler

While not directly related to communicating with other components, the Scheduler allows the delayed execution of methods. When a new event is scheduled, a ScheduledEvent object is created and can then be stored which then allows the event to be cancelled. The following definition is used to schedule an event:

ScheduledEvent Schedule(float delay, Action handler)

Where delay is the amount of time that should elapse before handler is executed. The scheduler can also accept parameters:

ScheduledEvent Schedule(float delay, Action handler, object arg)

This ScheduledEvent can later be cancelled with:

Cancel(ScheduledEvent scheduledEvent)

As an example, the Explode method will be called after 1.5 seconds:

Scheduler.Schedule(1.5f, Explode);

<- Shared Property and Method
Object Pool ->