Is there a way to suspend/toggle a script on and off, to avoid compiler errors in the meantime?
Whenever I update a script-heavy asset, all hell breaks loose. Scripts start missing references left and right. Missing namespaces front and back.
But in order for an update to "run it's course" the editor has to fully load. But the editor doesn't load fully when there's a compiler error. So it's a devil's cycle.
This could be fixed if I could somehow just temporarily "suspend" the affected scripts, and let the editor load up. Then I either fix the scripts manually then "unsuspend" the script to have it compile correctly, or the update implements missing namespaces/dictionaries/whatever-the-stuff-is-called-that-you-type-at-the-very-top-of-the-script, and the script runs again.
Is there an asset/ technique that people use to manage this sort of scenario?
Answer by Vyn_Halcyon · Aug 07, 2016 at 01:08 PM
I guess not.
I read somewhere that adding a "." prefix to a Unity Asset Folder hides it. But this method will require having explorer open on the second monitor to undo the hiding via folder rename.
Wonder if there is a better alternative.
Answer by Glurth · Aug 07, 2016 at 03:48 PM
I realize this is not great answer, but since I don't see any others:
Assuming your script is a component on an object, you can click it in the inspector to disable it.
If you have MANY such components, I would go into the script an manually remark out the code I want excluded, leaving the class itself, in place (to avoid missing references).
Oh, here is an alternative I just though of, but have never tested: you could add in this code to the script when you want i disabled.
OnEnable()
{
this.enabled=false;
}
Your answer
Follow this Question
Related Questions
The variables modified in the inspector are not kept on build 0 Answers
Custom inspector. Pick one bool from a list. 1 Answer
After Build Scripts no longer functioning in build or editor 1 Answer
Setting GameObject properties in editor when public script fields are changed 2 Answers
Parts of code only execute when there is a Debug.Log() statement in them. Why? 2 Answers