Author Topic: " 'UnityEditor' does not exist" after updating from free to paid  (Read 8263 times)

LordYabo

  • Guest
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!


appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: " 'UnityEditor' does not exist" after updating from free to paid
« Reply #1 on: May 31, 2013, 10:39:27 PM »
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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: " 'UnityEditor' does not exist" after updating from free to paid
« Reply #2 on: June 01, 2013, 01:46:28 AM »
Assets -> Sync MonoDevelop Project

LordYabo

  • Guest
Re: " 'UnityEditor' does not exist" after updating from free to paid
« Reply #3 on: June 01, 2013, 11:58:51 AM »
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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: " 'UnityEditor' does not exist" after updating from free to paid
« Reply #4 on: June 01, 2013, 03:20:03 PM »
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.