C# Класс UnityTools.Threading.UnityDispatcher

The UnityDispatcher class allows you to execute code on the main Unity thread. This is useful for situations where you need code on a seperate thread (i.e. slow IO operations) to access things that can only be accessed on the main thread.
Наследование: UnityEngine.MonoBehaviour, IInitialiseOnStartup, IDispatcher
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispatch ( System.Action action ) : void

Dispatches the action asynchronously on the Unity main thread. The action will execute in the next frame update phase.

DispatchWait ( System.Action action ) : void

Dispatches the action asynchronously on the Unity main thread but blocks the current thread until the action is executed. The action will execute in the next frame update phase.

Initialise ( ) : void
PumpActionQueue ( ) : void

This method should be executed on the main dispatch thread to execute the queued dispatch actions.

Приватные методы

Метод Описание
Awake ( ) : void
GetCurrentThreadId ( ) : int
Update ( ) : void

Описание методов

Dispatch() публичный Метод

Dispatches the action asynchronously on the Unity main thread. The action will execute in the next frame update phase.
public Dispatch ( System.Action action ) : void
action System.Action The action to execute on the dispatch thread.
Результат void

DispatchWait() публичный Метод

Dispatches the action asynchronously on the Unity main thread but blocks the current thread until the action is executed. The action will execute in the next frame update phase.
public DispatchWait ( System.Action action ) : void
action System.Action The action to execute on the dispatch thread.
Результат void

Initialise() публичный Метод

public Initialise ( ) : void
Результат void

PumpActionQueue() публичный Метод

This method should be executed on the main dispatch thread to execute the queued dispatch actions.
public PumpActionQueue ( ) : void
Результат void