Table of Contents

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 T

The 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 T

The prefab to instantiate.

position Vector3

The position.

rotation Quaternion

The 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 T
root 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 T
root GameObject
localPosition Vector3
localRotation Quaternion

Returns

T

Type Parameters

T

Instantiate(GameObject)

Instantiates a prefab.

public static GameObject Instantiate(GameObject prefab)

Parameters

prefab GameObject

The object.

Returns

GameObject

GameObject.

Instantiate(GameObject, Vector3, Quaternion)

Instantiates the specified prefab.

public static GameObject Instantiate(GameObject prefab, Vector3 position, Quaternion rotation)

Parameters

prefab GameObject
position Vector3
rotation 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 GameObject

The prefab.

root GameObject

The 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 GameObject

The prefab.

root GameObject

The root.

localPosition Vector3

The local position.

localRotation Quaternion

The local rotation.

Returns

GameObject

GameObject.