Utility to copy UnityEngine.Component
or UnityEngine.Material
and paste it back.
More...
Inherits EditorWindow, and IHasCustomMenu.
Public Member Functions | |
void | AddItemsToMenu (GenericMenu menu) |
Add the window context menu items. More... | |
Static Public Member Functions | |
static void | OpenWindow () |
Open the window. More... | |
static bool | IsCopyable (Object source) |
Determine if the specified source is able to copy to clipboard. More... | |
static void | Copy (params Object[] sources) |
Copy the specified sources to clipboard. More... | |
static void | Clear (Type type=null) |
Clear clipboard by specified type, or pass null to clear all. More... | |
Public Attributes | |
bool | track |
Flag to track selection to change search filter automatically. More... | |
string | search = "" |
The search filter pattern in the search bar. More... | |
bool | setting |
Flag to show settings. More... | |
Properties | |
static bool | preferPersist [get, set] |
Flag to persist new copies as asset if possible. More... | |
Utility to copy UnityEngine.Component
or UnityEngine.Material
and paste it back.
Useful for tweaking lots of objects in the editor, even in play mode. Click the menu "Window/Clipboard" to open the window. Just play and tweak, drag and drop, copy and paste whenever. It acts as sort of preset system, edit lots of copies as presets, and paste to apply values quickly. Easy to find and manage copies with a search filter, custom item label, and foldable inspector.
Copy:
UnityEngine.GameObject
to copy the components on it.Paste:
Filter items with the search bar:
Edit the item label:
Find the copy source object:
The reasons not to save the trace by references below:
For component references to scene object. This creates copies and store in editor scene temporarily to ensure content correct. It means the copy will be destroyed when quitting the editor. And also, the scene references will become missing when opening another scene. The situation above is applicable to a material with scene texture, too.
For material or component without reference to any scene object. The copies will be saved with a label "Ignore" in an asset folder to make them still until manually "Clear". This tracks all copies by specific name or folder to ensure valid after script reloaded.
SVN users may clear all manually to avoid committing, or ignore the storing folder below:
Instructions, to copy and paste generic component is dangerous, even if reflect all the fields. Since we'll never know what the developer do when the component awake. As the thread I commented, we'd be very careful with which aren't made by ourselves. Finally, this was created, works in the editor with Unity built-in classes and API.
|
static |
Open the window.
|
static |
Determine if the specified source is able to copy to clipboard.
source | Source object. |
true
if is copyable; otherwise, false
.
|
static |
Copy the specified sources to clipboard.
sources | Source objects. |
|
static |
Clear clipboard by specified type, or pass null
to clear all.
void AddItemsToMenu | ( | GenericMenu | menu | ) |
Add the window context menu items.
Menu "About" to open the online manual, and "Settings" for common preferences. Menu "New Window" to open another Clipboard
window.
menu | Menu. |
bool track |
Flag to track selection to change search filter automatically.
string search = "" |
The search filter pattern in the search bar.
bool setting |
Flag to show settings.
|
staticgetset |
Flag to persist new copies as asset if possible.
Enable to save the copies for next time opening the project. Disable to make copying faster without creating asset if you don't need. It only applies to copy operations after changing this setting.