Programmers learn & share
0 votes
34 views

Problem :

Unable to find solution for bellow error
the type or namespace name `unityeditor' could not be found. are you missing an assembly reference?
by (6.9k points)   | 34 views

1 Answer

0 votes

Solution :

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.

Further Readings:

https://github.com/microsoft/RoomAliveToolkit/issues/75

by (36.1k points)  
2,183 questions
2,487 answers
59 comments
241 users