I have a component, that I want to automatically reset when the game object it is attached to is duplicated / cloned in the editor.
I have tried doing this with a stored ID, and every time you inspect the component it looks through the whole scene for other objects with the same ID and if there is one, resets itself. But this is a very clumsy way of doing it, and it's very specific (I have to individually reset every variable).
Is there a way to reset a component?
Is there a way to catch duplication?
Is it possible to do this from a custom editor instead of the component itself (lets say I don't have access to the component's script)?
You could save the "restored" version as a prefab, and instance off of that?
answered Oct 28 '10 at 02:17 AM