Wanzyee Studio

Adapt built-in initialize method attribute with callback order. More...

Inherits Attribute.

Public Member Functions

 InitializeMethodAttribute (int order=0)
 Initialize in runtime after scene is loaded. More...
 
 InitializeMethodAttribute (RuntimeInitializeLoadType runtime, int order=0)
 Initialize in runtime with the specified load type. More...
 
 InitializeMethodAttribute (bool editor, bool runtime, int order=0)
 Initialize after scripts loaded. More...
 

Public Attributes

readonly int order
 The initialize callback order. More...
 
readonly bool editor
 If to initialize in editor after scripts loaded. More...
 
readonly RuntimeInitializeLoadType runtime = (RuntimeInitializeLoadType)(-1)
 The runtime initialize load type. More...
 

Detailed Description

Adapt built-in initialize method attribute with callback order.

Used to replace or combine:

  1. UnityEngine.RuntimeInitializeOnLoadMethodAttribute.
  2. UnityEditor.InitializeOnLoadMethodAttribute.

Constructor & Destructor Documentation

InitializeMethodAttribute ( int  order = 0)

Initialize in runtime after scene is loaded.

Parameters
orderThe order.
InitializeMethodAttribute ( RuntimeInitializeLoadType  runtime,
int  order = 0 
)

Initialize in runtime with the specified load type.

Parameters
runtimeThe load type.
orderThe order.
InitializeMethodAttribute ( bool  editor,
bool  runtime,
int  order = 0 
)

Initialize after scripts loaded.

Parameters
editorIf to initialize in editor.
runtimeIf to initialize in runtime.
orderThe order.

Member Data Documentation

readonly int order

The initialize callback order.

readonly bool editor

If to initialize in editor after scripts loaded.

readonly RuntimeInitializeLoadType runtime = (RuntimeInitializeLoadType)(-1)

The runtime initialize load type.