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.DeepCopyComponentsFrom<T>(GameObject, GameObject) Method

Creates a deep copy of components from the source towards another Game Object.

public static System.Collections.Generic.List<T> DeepCopyComponentsFrom<T>(this GameObject targetGameObject, GameObject sourceGameObject)
    where T : Component;

Type parameters

T
A Unity Component

Parameters

targetGameObject UnityEngine.GameObject
The target Game Object where components will be copied to

sourceGameObject UnityEngine.GameObject
Source where the original components derived from

Returns

System.Collections.Generic.List<T>
List of deep copied components