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

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

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

Type parameters

T
A Unity Component

Parameters

sourceGameObject UnityEngine.GameObject
Source where the original components derived from

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

Returns

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