Class UnityMainThreadDispatcher
Unity-specific main-thread dispatcher.
Captures the UnitySynchronizationContext and dispatches calls to it
when the target type or method parameters involve Unity API types.
Inheritance
UnityMainThreadDispatcher
Assembly: Serenity.UnityGlobal.Infrastructure.dll
Syntax
public sealed class UnityMainThreadDispatcher : IMainThreadDispatcher
Constructors
UnityMainThreadDispatcher()
Declaration
public UnityMainThreadDispatcher()
Properties
IsAvailable
Declaration
public bool IsAvailable { get; }
Property Value
Methods
CaptureContext()
Captures the current synchronization context if it is the Unity context.
Call this once from the main thread (e.g. during bootstrap).
Declaration
public void CaptureContext()
InvokeOnMainThreadAsync(Func<Task>)
Declaration
public Task InvokeOnMainThreadAsync(Func<Task> action)
Parameters
Returns
RequiresMainThread(MethodInfo, Type)
Declaration
public bool RequiresMainThread(MethodInfo method, Type targetType)
Parameters
Returns
Implements