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

◆ GameObject() [9/24]

Sisus.Init.GameObject< TFirstComponent, TSecondComponent, TThirdComponent >.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 .

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 and then calling an Init3 function with arguments matching the argument list defined by the IArgs interface that TThirdComponent implements.

The new GameObject is always first created in an inactive state and only activated once both components have been added and initialized and only if active is set to true. This ensures that the Awake and OnEnable event functions for the component are only called after the component has been initialized with its dependencies.

Parameters
parentThe parent of the created GameObject.
positionThe position for the GameObject.
eulerAnglesThe orientation of the GameObject.
scaleThe scale of the GameObject.
inWorldSpacetrue to set the position, rotation and scale for the new GameObject directly in world space or false to set them relative to the GameObject's new parent .
activeDefines whether the created GameObject is active in the Scene.