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

The prefab to instantiate.

root GameObject

The parent GameObject to attach the instance to.

Returns

T

The instantiated component.

Type Parameters

T

The component type on the prefab.

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

The prefab to instantiate.

root GameObject

The parent GameObject to attach the instance to.

localPosition Vector3

The local position to set on the instance.

localRotation Quaternion

The local rotation to set on the instance.

Returns

T

The instantiated component.

Type Parameters

T

The component type on the prefab.

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 at the given position and rotation.

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

Parameters

prefab GameObject

The prefab to instantiate.

position Vector3

The world position for the new instance.

rotation Quaternion

The world rotation for the new instance.

Returns

GameObject

The instantiated 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.