CustomEditor stops displaying after changing script location
My CustomEditor script is no longer displaying, and I don't have any reasonable cause, error or even something I can test it against to properly ask what's going on... I'm going to be providing a lot of context to make sure you can spot the detail where I may have gone wrong. Project Source at the bottom.
I recently tried Building my project for the first time, which required me to make edits like separating UnityEditor and regular Unity import stuff. I got that all worked out and moved some scripts into a 'Editor' folder while I finally started moving Scripts into a 'Scripts' folder (I hadn't done so before hand). I also figured out and used the #if UNITY_EDITOR
macro. After doing this, I was able to Build and Run my application for the first time, properly.
However, after getting this working (building), my CustomEditor implementation started failing with this message:
Instance of BoidControllerEditor couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.
I tried moving my CustomEditor script into the Scripts
folder and putting a #if UNITY_EDITOR
macro over the entire thing, but that didn't work (it's dumb, but I just wanted a quick fix in the mean time).
But now, for some reason, my CustomEditor won't work. I didn't change anything, just the script location. Moving it back hasn't worked, restarting Unity hasn't worked, resetting the Monobehaviour component failed... I don't know what the cause is, since it was working perfectly.
If you want to view my project's sourcecode, you can see it on GitHub in it's entirety here. The link is to the current project version as of posting.
Answer by Xevioni · May 19, 2020 at 01:18 PM
Ugh, for some reason, restarting Unity solved my problem. How fun.
Your answer
Follow this Question
Related Questions
Target field of a MonoBehaviour attribute ? 1 Answer
Custom Editor List with child classes 1 Answer
What is the editor callback for mouse hover 0 Answers
Property drawer with multiple fields: only first field has prefab override implemented 1 Answer
How to edit array/list property with custom PropertyDrawer? 3 Answers