Want to solve programming problems and get paid for it? If that sounds interesting to you then contact us.
I had faced a similar problem with one of my scriptable objects in the past. My scriptable object was not an editor script but it had OnInspectorGUI code in it was used so that I only need to write the inspector gui for the scriptable object once.
I fixed the problem by putting #if UNITY_EDITOR before using UnityEditor directive and #endif after it. You will also need to surround your GUI code with these same tags.