Class ScriptScheduler¶
Namespace: Apogee.Scripting
Assembly: Apogee.Scripting.dll
The tasks of one VM (and its tweens, which it steps and cancels along with them): what task.spawn, task.defer, task.delay and task.every start, and what task.wait puts to sleep. A task is a Luau thread the scheduler
resumes: at once (spawn), at the next drain (defer), when its time comes (delay, wait, every). There is no clock in here:
public sealed class ScriptScheduler
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Count¶
The tasks that have not ended: asleep, deferred or running.
public int Count { get; }
Property Value¶
RealTime¶
Real seconds since the VM started, whatever the time scale: the clock of task.wait_real.
public double RealTime { get; }
Property Value¶
Time¶
Game seconds since the VM started: what task.time() gives, and the clock of task.wait, task.delay and task.every. It stops while the game's time scale is 0.
public double Time { get; }
Property Value¶
TweenCount¶
The tweens that have not ended: playing, delayed or paused.
public int TweenCount { get; }
Property Value¶
Methods¶
CancelAll()¶
Stops every task and tween: the VM is going away. A tween stopped this way emits no signal.
public void CancelAll()
CancelOwner(ScriptOwner)¶
Stops every task and tween of owner: what a mod that failed to load leaves behind. A tween stopped this way emits no signal.
public void CancelOwner(ScriptOwner owner)
Parameters¶
owner ScriptOwner
CountOf(ScriptOwner)¶
The tasks of owner that have not ended.
public int CountOf(ScriptOwner owner)
Parameters¶
owner ScriptOwner
Returns¶
TweenCountOf(ScriptOwner)¶
The tweens of owner that have not ended.
public int TweenCountOf(ScriptOwner owner)
Parameters¶
owner ScriptOwner
Returns¶
TaskFailed¶
Raised when a task ends with an error, a timeout or a memory error (it is logged too), with its owner and the message. The script that started the task never sees the error.
public event Action<ScriptOwner, string>? TaskFailed