RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

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

T
A Unity Component

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