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

Description

Builder for creating a new GameObject with two components.

The components must be initialized by first calling an Init1 function with arguments matching the argument list defined by the IArgs interface that TFirstComponent implements and then calling an Init2 function with arguments matching the argument list defined by the IArgs interface that TSecondComponent implements.

If neither component implements any IArgs interfaces then a single call to the parameterless Init function can be used to initialize both components.

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

Template Parameters
TFirstComponentType of the first added component.
TSecondComponentType of the second added component.
Type Constraints
TFirstComponent :Component 
TSecondComponent :Component 

Public Member Functions

 GameObject (string name)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (string name, bool active)
 
 GameObject (string name, Transform parent, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (bool active)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Transform parent, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Transform parent, Vector3 position, bool positionInWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Transform parent, Vector3 position, Quaternion rotation, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Transform parent, Vector3 position, Quaternion rotation, Vector3 scale, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Transform parent, Vector3 position, Vector3 eulerAngles, Vector3 scale, bool inWorldSpace=false, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (Vector3 position, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject (string name, Vector3 position, bool active=true)
 Starts the process of creating a new GameObject with components of type TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, bool active)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, bool positionInWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, bool inWorldSpace=false)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 GameObject ([DisallowNull] GameObject original, Transform parent, Vector3 position, Vector3 eulerAngles, bool inWorldSpace, bool active)
 Starts the process of cloning the original GameObject with a component of type TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 
 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 TFirstComponent and TSecondComponent .
 

Static Public Member Functions

static implicit operator GameObject (GameObject< TFirstComponent, TSecondComponent > @this)
 Gets the GameObject to which the components are added.
 
static implicit operator Transform (GameObject< TFirstComponent, TSecondComponent > @this)
 Gets the Transform component of the GameObject to which the components are added.
 
static implicit operator TFirstComponent (GameObject< TFirstComponent, TSecondComponent > @this)
 Gets the first component added to the GameObject.
 
static implicit operator TSecondComponent (GameObject< TFirstComponent, TSecondComponent > @this)
 Gets the second component added to the GameObject.
 
static implicit operator (TFirstComponent, TSecondComponent)(GameObject< TFirstComponent
 Gets a tuple containing the two components added to the GameObject.