GameObjectExtensions.CopyComponent_UNSAFE<T>

Extension Method in GameObjectExtensions

Declaration

public static T CopyComponent_UNSAFE<T>(this GameObject gameObject, T component)
    where T : Component

Description

Copies a component from one game object to another with the exact same values.

Type Parameters

TThe type of component to copy.

Parameters

gameObjectThe game object to copy the component to.
componentThe component to copy.

Returns

TThe copied component.