Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: LordYabo on May 31, 2013, 03:55:29 PM
-
I upgraded from free to the latest version just now. Followed the update instructions (start new scene, delete NGUI, reimport nGUI) and my game runs fine.
But when I go to edit any of my C#, I get this error compiling the project:
------ Build started: Project: UnityVS.ScifiEmpire.CSharp, Configuration: Debug Any CPU ------
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(270,4): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(453,8): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(453,64): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(453,93): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(454,5): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Internal\UIWidget.cs(480,20): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIAtlas.cs(373,3): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIAtlas.cs(389,5): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIAtlas.cs(406,5): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIAtlas.cs(423,5): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIPanel.cs(584,20): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIPanel.cs(1034,20): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\UI\UIFont.cs(599,3): error CS0103: The name 'UnityEditor' does not exist in the current context
C:\Programming\ScifiEmpire\Assets\NGUI\Scripts\Interaction\UIPopupList.cs(171,6): error CS0103: The name 'UnityEditor' does not exist in the current context
I don't know a lot about Unity. I'm using VSUnity. In Visual Studio there are two projects in the SLN:
UnityVS.ScifiEmpire.CSharp
UnityVS.ScifiEmpire.CSharp.Editor
It seems to me that the NGUI stuff in the first project shouldn't be looking for the editor. Or the preprocessor flag of #if UNITY_EDITOR is for some reason turned on in that project.
I don't know what to do!
-
I don't know how VSUnity changes things, but it looks like it's missing the reference to UnityEditor.dll, found here in Windows:
C:\Program Files (x86)\Unity\Editor\Data\Managed
You might try adding a reference to that.
-
Assets -> Sync MonoDevelop Project
-
Thanks for the help, but the project that won't compile with the build parameter of UNITY_EDITOR does have a reference to UnityEditor (and the dll) in it.
I did run the Assets Sync Mono Develop, but since i'm not using monodevelop it had no affect. I'm using Visual Studio with VSUnity plugin.
I never had this issue with the free version of NGUI. This only happened when I updated to the paid version.
I've attached a screen shot of my project in VS in case you can spot something wrong.
-
I use Visual Studio as well, and I set up Unity to use it instead of MonoDevelop. Why is your solution named UnityVS.ScifiEmpire? The correct solution that Unity creates is always called Assembly-CSharp, and that's what Unity opens when you double-click on a file.