- Home /
Access a class from Editor script? (Visual Studio)
I followed this unity docs tutorial: https://docs.unity3d.com/ScriptReference/Editor.OnSceneGUI.html
Placed DrawLineEditor within Editor folder. Placed DrawLine outside of Editor folder. Attached DrawLine to a GameObject, added some GameObjects to scene and registered them in DrawLine script via inspector. In unity, everything shows correctly.
After i opened the DrawLineEditor in VisualStudio, the VS reports error: "CS0246 The type or namespace name 'DrawLine' could not be found (are you missing a using directive or an assembly reference?)"
and all istances of "DrawLine" are red-underlined, showing error. How do i fix this in VisualStudio so that it recognizes "DrawLine" outside of the Editor folder? Namespaces dont seem to work either.
Answer by _watcher_ · Jan 09, 2018 at 02:26 PM
nwm! moved the DrawLineEditor out of "Editor" folder and back again a few times and "VS fixed itself".
Your answer
![](https://koobas.hobune.stream/wayback/20220612150137im_/https://answers.unity.com/themes/thub/images/avi.jpg)