Description
The CopyToClipboard
method is a static extension method provided by the SceneExtensions
class in the Sandbox namespace. This method allows you to copy the data of a specified Component
to the system clipboard. This can be useful for duplicating component configurations or for transferring component data between different parts of your application or between different applications.
Usage
To use the CopyToClipboard
method, you need to have a reference to a Component
object that you want to copy. You can then call this method as an extension method on the Component
instance.
Example usage:
Component myComponent = someGameObject.GetComponent<MyComponentType>();
SceneExtensions.CopyToClipboard(myComponent);
Ensure that the component is not null before calling this method to avoid runtime exceptions.
Example
Component myComponent = someGameObject.GetComponent<MyComponentType>();
SceneExtensions.CopyToClipboard(myComponent);