Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.GameObject< TComponent > Struct Template Reference

Description

Builder for creating a new GameObject with a component of type TComponent .

The component must be initialized by calling an Init function with arguments matching the argument list defined by the IArgs interface that TComponent implements.

If TComponent does not implement any IArgs interface then the parameterless Init function should be used.

The new GameObject is first created in an inactive state and only activated once the component has been initialized. This ensures that the Awake and OnEnable events for the component are only called after the component has received all its dependencies.

Template Parameters
TComponentType of the added component.
Type Constraints
TComponent :Component 

Public Member Functions

 GameObject (string name)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (string name, Transform parent, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (string name, bool active)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (string name, HideFlags hideFlags)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (bool active)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Transform parent, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Transform parent, Vector3 position, bool positionInWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Transform parent, Vector3 position, Quaternion rotation, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Transform parent, Vector3 position, Quaternion rotation, Vector3 scale, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, bool inWorldSpace=false)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, bool inWorldSpace, bool active)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Transform parent, Vector3 position, Vector3 eulerAngles, Vector3 scale, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (Vector3 position, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject (string name, Vector3 position, bool active=true)
 Starts the process of creating a new GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, bool active)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, bool positionInWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, bool positionInWorldSpace, bool active)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Quaternion rotation, bool inWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Quaternion rotation, bool inWorldSpace, bool active)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Quaternion rotation, Vector3 scale, bool inWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Quaternion rotation, Vector3 scale, bool inWorldSpace, bool active)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, Vector3 scale, bool inWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, Vector3 scale, bool inWorldSpace, bool active)
 Starts the process of cloning the original GameObject with a component of type TComponent .
 

Static Public Member Functions

static implicit operator GameObject (GameObject< TComponent > @this)
 Gets the GameObject to which the component is added.
 
static implicit operator Transform (GameObject< TComponent > @this)
 Gets the Transform component of the GameObject to which the component is added.
 
static implicit operator TComponent (GameObject< TComponent > @this)
 Gets the component that is added to the GameObject.