MainThreadclass

Utility functions that revolve around the main thread

object→MainThread
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public static abstract sealed class Sandbox.MainThread

Methods2

Showing 2 methods

public static void Queue(System.Action method)PUBLICSTATIC

When running in another thread you can queue a method to run in the main thread. Queued methods retain the originating game or menu context. If you are on the main thread we will execute the method immediately and return.

ParameterTypeDescription
methodAction—
Returns:void—

public static Sandbox.Tasks.SyncTask Wait()PUBLICSTATIC

Wait to execute on the main thread

Returns:SyncTask—

On this page