ScriptSystemExtensions.

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

Summary

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

Syntax

public static MicroThread AddTask(this ScriptSystem scriptSystem, Func<Task> action, TimeSpan delay, TimeSpan repeatEvery, 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.
repeatEvery TimeSpan The amount of time to wait for between repetition.
priority long The priority of the micro thread action being added.

Return Value

Type Description
MicroThread The MicroThread.