v1.1.0
Latest
2021.3+

Class TaskSchedulerWebGL

Provides the means to schedule tasks on a background thread or the main thread. Also allows for creation of co-routines from classes that do not inherit from MonoBehaviour.

This is thread safe, through it must be constructed on the main thread.

Inherited Members
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: Unity.Services.Relay.Scheduler
Syntax
public sealed class TaskSchedulerWebGL : TaskScheduler

Methods

IsMainThread()

Determines whether the current thread is the main thread. WebGL currently runs on a single thread, so this will always be false.

Declaration
public override bool IsMainThread()
Returns
TypeDescription
Boolean

Whether or not this thread is the main thread.

Overrides

ScheduleBackgroundTask(Action)

Schedules a new task on a background thread. NOTE: In WebGL, multi-threading isn't supported, so this will be scheduled on main thread instead.

Declaration
public override void ScheduleBackgroundTask(Action task)
Parameters
TypeNameDescription
Actiontask

The task that should be executed on a background thread.

Overrides

ScheduleMainThreadTask(Action)

Schedules a new task on the main thread. The task will be executed during the next update.

Declaration
public override void ScheduleMainThreadTask(Action task)
Parameters
TypeNameDescription
Actiontask

The task that should be executed on the main thread.

Overrides