Quantcast
Channel: Answers for "How to reset a component on duplication?"
Browsing latest articles
Browse All 7 View Live

Answer by Max Kaufmann

You could save the "restored" version as a prefab, and instance off of that?

View Article



Answer by IzzySoft

Hmm... Have you tried: [ExecuteInEditMode] public class myObject : MonoBehaviour { [NonSerialized] public bool isDuplicate = true; void Awake() { myObject mo = this as myObject; Debug.Log( "In Awake....

View Article

Answer by bjennings76

I wasn't able to find a good way to directly call the 'Reset' function that the Inspector menu has, but I was able to cheat by deleting/recreating the component when it's instance ID doesn't match the...

View Article

Answer by CaseyHofland

Late but for new readers: Here is the definitive way to do it! public class Foo : MonoBehaviour #if UNITY_EDITOR , ISerializationCallbackReceiver #endif { private GameObject childObject; #if...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images