Method Instantiate
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Instantiate<T>(T, GameObject)
Instantiates a prefab and attaches it to the given root.
public static T Instantiate<T>(T prefab, GameObject root) where T : Component
Parameters
prefabTrootGameObject
Returns
- T
Type Parameters
T
Instantiate<T>(T, GameObject, Vector3, Quaternion)
Instantiates a prefab, attaches it to the given root, and sets the local position and rotation.
public static T Instantiate<T>(T prefab, GameObject root, Vector3 localPosition, Quaternion localRotation) where T : Component
Parameters
prefabTrootGameObjectlocalPositionVector3localRotationQuaternion
Returns
- T
Type Parameters
T
Instantiate(GameObject)
Instantiates a prefab.
public static GameObject Instantiate(GameObject prefab)
Parameters
prefabGameObjectThe object.
Returns
- GameObject
GameObject.
Instantiate(GameObject, Vector3, Quaternion)
Instantiates the specified prefab.
public static GameObject Instantiate(GameObject prefab, Vector3 position, Quaternion rotation)
Parameters
prefabGameObjectpositionVector3rotationQuaternion
Returns
Instantiate(GameObject, GameObject)
Instantiates a prefab and parents it to the root.
public static GameObject Instantiate(GameObject prefab, GameObject root)
Parameters
prefabGameObjectThe prefab.
rootGameObjectThe root.
Returns
- GameObject
GameObject.
Instantiate(GameObject, GameObject, Vector3, Quaternion)
Instantiates a prefab, attaches it to the given root, and sets the local position and rotation.
public static GameObject Instantiate(GameObject prefab, GameObject root, Vector3 localPosition, Quaternion localRotation)
Parameters
prefabGameObjectThe prefab.
rootGameObjectThe root.
localPositionVector3The local position.
localRotationQuaternionThe local rotation.
Returns
- GameObject
GameObject.