ScriptSystemExtensions.

AddTask(ScriptSystem, Func<Task>, TimeSpan, long) Method

Summary

Adds a micro thread function to the scriptSystem that executes after waiting specified delay.
Namespace
StrideToolkit.Engine
Containing Type
ScriptSystemExtensions

Syntax

public static MicroThread AddTask(this ScriptSystem scriptSystem, Func<Task> action, TimeSpan delay, long priority = 0)

Remarks

If the action is a ScriptComponent instance method the micro thread will be automatically stopped if the ScriptComponent or Entity is removed.

Parameters

Name Type Description
scriptSystem ScriptSystem The ScriptSystem.
action Func<Task> The micro thread function to execute.
delay TimeSpan The amount of time to wait for.
priority long The priority of the micro thread action being added.

Return Value

Type Description
MicroThread The MicroThread.