Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ Context

Specifies different contexts of interest from which methods can be called during initialization.

Used to identify the initialization phase during which a client is trying to get arguments that have been provided for it. Certain functionality of methods can be available only in particular contexts, sometimes for thread safety reasons, and other times because it is desired by-design.

Enumerator
Default 

The method can be getting called from a background thread; not a thread safe context.

Whether the method is getting called in edit mode or at runtime is undetermined.

MainThread 

The method is for certain getting called from the main thread.

A thread safe context.

EditMode 

The method is for certain getting called in edit mode.

See also
InitInEditModeAttribute
Runtime 

The method is for certain getting called at runtime; either in a build or in Play Mode in the editor.

Constructor 

The method is getting called from a constructor.

Not a thread safe context.

Maybe edit mode.

See also
ConstructorBehaviour<TArgument>
OnAfterDeserialize 

The method is getting called during the ISerializationCallbackReceiver.OnAfterDeserialize event.

Not a thread safe context.

Maybe edit mode.

Reset 

The method is getting called during the Reset event.

A thread safe context.

Is edit mode.

See also
InitOnResetAttribute
OnValidate 

The method is getting called from the OnValidate event function in edit mode.

Not a thread safe context.

Awake 

The method is getting called from an Awake event function.

A thread safe context.

OnEnable 

The method is getting called from an OnEnable event function.

A thread safe context.

Start 

The method is getting called from a Start event function.

A thread safe context.