ChensHelpers
Chen.Helpers.UnityHelpers.Extensions
Extensions.DeepCopy<T>(T, GameObject) Method
Creates a deep copy of a component and attaches it to the target Game Object.
public static T DeepCopy<T>(this T originalComponent, GameObject targetGameObject)
where T : Component;
Type parameters
Parameters
originalComponent
T
The basis of the deep copy
targetGameObject
UnityEngine.GameObject
The target Game Object where the deep copy component will be added to
Returns
T
The deep copied component