Method Instantiate
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Instantiate<T>(T)
Instantiates the specified prefab.
public static T Instantiate<T>(T prefab) where T : Component
Parameters
prefab
TThe object.
Returns
- T
T.
Type Parameters
T
Instantiate<T>(T, Vector3, Quaternion)
Instantiates an object at the given position in the given orientation.
public static T Instantiate<T>(T prefab, Vector3 position, Quaternion rotation) where T : Component
Parameters
prefab
TThe prefab to instantiate.
position
Vector3The position.
rotation
QuaternionThe rotation.
Returns
- T
T.
Type Parameters
T
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
prefab
Troot
GameObject
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
prefab
Troot
GameObjectlocalPosition
Vector3localRotation
Quaternion
Returns
- T
Type Parameters
T
Instantiate(GameObject)
Instantiates a prefab.
public static GameObject Instantiate(GameObject prefab)
Parameters
prefab
GameObjectThe object.
Returns
- GameObject
GameObject.
Instantiate(GameObject, Vector3, Quaternion)
Instantiates the specified prefab.
public static GameObject Instantiate(GameObject prefab, Vector3 position, Quaternion rotation)
Parameters
prefab
GameObjectposition
Vector3rotation
Quaternion
Returns
- GameObject
Instantiate(GameObject, GameObject)
Instantiates a prefab and parents it to the root.
public static GameObject Instantiate(GameObject prefab, GameObject root)
Parameters
prefab
GameObjectThe prefab.
root
GameObjectThe 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
prefab
GameObjectThe prefab.
root
GameObjectThe root.
localPosition
Vector3The local position.
localRotation
QuaternionThe local rotation.
Returns
- GameObject
GameObject.