From what I’ve found, I can replace the inspector properties in the editor using a CustomEditor script or I can simply extend a class and have the child class replace function calls.
What I’m not sure how to do, however, is combine these elements, if possible. What I’m aiming to do is provide rudimentary logic on Shader manipulation in a built environment, while providing the editor with a much more capable system, utilizing ShaderUtil (which cannot be built). Ideally, I’m looking to call the basic form of the script and have the editor-specific version override the functions and features.
As-is, I’m only finding an option to use [CustomEditor(typeof(ScriptTest))] and extend the Editor to automatically load the script and override OnInspectorGUI().
That’s far too limited of a scope, however, and I really want to be able to override everything while keeping the editor-specific script in the Editor folder. Then, it can behave one way in the editor and change its behavior when built.
Is there some easy means of doing this that I’m simply missing? Or is this actually a particularly challenging task?
Edit: Specifically, ShaderUtil is letting me grab shader attribute properties not otherwise available. Because ShaderUtil is editor-only, however, not having access to that in a build would essentially mean having to guess at names of properties (such as _MainTex), to the best of my knowledge.
I tried utilizing #if UNITY_EDITOR and #if UNITY_STANDALONE properties, but standalone appears to also be valid while in the editor, so that doesn’t really work, since I need one or the other and not a mix of both.
Edit again: Well, I’m a dope for forgetting about the word #else but I still find it weird that “standalone” doesn’t exclude the editor.