ScriptSystemExtensions.

AddOnEventTask<T>(ScriptSystem, EventReceiver<T>, Func<T, Task>, long) Method

Summary

Adds a micro thread function to the scriptSystem that executes when the event is published.
Namespace
StrideToolkit.Engine
Containing Type
ScriptSystemExtensions

Syntax

public static MicroThread AddOnEventTask<T>(this ScriptSystem scriptSystem, EventReceiver<T> receiver, Func<T, Task> action, 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.

Type Parameters

Name Description
T The type of the event handler parameter.

Parameters

Name Type Description
scriptSystem ScriptSystem The ScriptSystem.
receiver EventReceiver<T> The event reciever to listen to for.
action Func<T, Task> The micro thread function to execute.
priority long The priority of the micro thread action being added.

Return Value

Type Description
MicroThread The MicroThread.