Method Clone
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Clone<T>(T)
Clones a MonoBehaviour using UnityEngine.Object.Instantiate<T>(T).
public static T Clone<T>(this T obj) where T : MonoBehaviour
Parameters
objTThe object to clone.
Returns
- T
A new instance of the object.
Type Parameters
TThe MonoBehaviour type to clone.
Clone<T>(T, int)
Clones a MonoBehaviour a given number of times.
public static List<T> Clone<T>(this T obj, int count) where T : MonoBehaviour
Parameters
objTThe object to clone.
countintThe number of clones to create.
Returns
- List<T>
A list of cloned instances.
Type Parameters
TThe MonoBehaviour type to clone.