Skip to content

Class: Scheduler ​

Game-time scheduler ticked by SchedulerSystem each Update — callbacks ride the engine clock. Context (the third arg) is bound as this so passing this from a script makes method-style callbacks work directly.

Re-entrant: scheduling from inside a callback joins next tick; cancellations during dispatch are deferred to the end-of-tick sweep.

Constructors ​

Constructor ​

ts
new Scheduler(): Scheduler;

Returns ​

Scheduler

Properties ​

PropertyModifierType
sharedreadonlyScheduler

Methods ​

Count() ​

ts
Count(): number;

Returns ​

number


Schedule() ​

ts
Schedule(
   callback, 
   interval, 
   context?, 
   repeat?, 
   delay?
): number;

repeat = -1 for infinite. delay overrides the time before the first fire (defaults to interval).

Parameters ​

ParameterTypeDefault value
callback(...args) => unknownundefined
intervalnumberundefined
context?objectundefined
repeat?number-1
delay?numberundefined

Returns ​

number


ScheduleNextFrame() ​

ts
ScheduleNextFrame(callback, context?): number;

Parameters ​

ParameterType
callback(...args) => unknown
context?object

Returns ​

number


ScheduleOnce() ​

ts
ScheduleOnce(
   callback, 
   delay, 
   context?
): number;

Parameters ​

ParameterType
callback(...args) => unknown
delaynumber
context?object

Returns ​

number


Tick() ​

ts
Tick(dt, isPaused?): void;

isPaused(context) true = that task holds this tick (its clock doesn't advance) — tasks of a script whose entity is inactive (Cocos pauses a node's schedules the same way).

Parameters ​

ParameterType
dtnumber
isPaused?(context) => boolean

Returns ​

void


Unschedule() ​

ts
Unschedule(handle): void;

Parameters ​

ParameterType
handlenumber

Returns ​

void


UnscheduleAll() ​

ts
UnscheduleAll(): void;

Returns ​

void


UnscheduleAllForTarget() ​

ts
UnscheduleAllForTarget(context): void;

Parameters ​

ParameterType
contextobject

Returns ​

void

© 2026 PlayAdGentic