- Home /
Reset or Reinstantiate Custom Editors Target(s)
Is there a way for a custom editor to re-instantiate it's target? For example, when first loading the editor the target will have it's Awake() and Start() methods invoked. If I modify a value in the custom editor I would like to destroy the associating target and re-instantiate it. So far the best approach I could find was to explicitly call the OnDestroy(), then Awake(), then Start() method on the target whenever a change occurs. Wasn't sure if there was a better way to do this.
Answer by Adam-Mechtley · Nov 14, 2016 at 08:36 AM
Hi @FatCatz! I doubt you want to destroy the target, as this can cause problems later in the GUI loop when the target is expected to exist. Is there a reason to not implement a Reset() method for the target?
I had no idea such a method existed. Thanx! Exactly what I'm looking for.