Author Topic: Compile errors after updating NGui and HudText  (Read 5202 times)

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Compile errors after updating NGui and HudText
« on: February 01, 2014, 05:03:22 PM »
Thanks in advance,

I was still experiencing issues with Atlas not allowing me to add sprites and other unusual behaviors. So I noticed there was an update available when I pulled up the asset store in Unity. I did the upgrade and now I'm getting two compile errors that I can't get past. I wish I know more about how all this fits together so I wouldn't have to reach out to the support forum... but at this point when things blow up like this I just don't understand why this particular script out of all the various scripts in NGui has the problem.

Screenshot attached.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #1 on: February 01, 2014, 06:52:23 PM »
UISlicedSprite doesn't exist anymore. It was remoted a very long time ago.

You need to follow the 3 step upgrade process from the readme file that involves removing NGUI prior to importing the update.

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #2 on: February 01, 2014, 08:45:43 PM »
Many thanks for your help. I'm going to try once again but I'm almost certain i removed every part of NGui and re installed more than a few times. Also to add, I've only been using NGui for about a month so I'm not sure how such an older script that was removed a very long time ago got into my project.  My purchase date was probably around 1/10/2014 and I downloaded right off the Asset Store.

I genuinely appreciate your fast responses and will try again wiping NGui from the project and re-installing. It is weird that everything was all just fine and then it just all fell apart starting about noon yesterday.  Until then I had no problems at all. Most likely in attempting to add sprites to my Atlas (I gave up on that and just started using textures) I broke something. You know as you troubleshoot trying to find out why things are not working eventually you end up doing something to make it worse.

I have a five scene game and right now because of those two compile errors not a single scene will run. One major weakness in Unity (not a NGui problem) is that it really seems to latch on to compile errors in scripts that have nothing to with the scene you might be working on. So I'll get a problem in a scene with a script and decide to move on to another scene and work on something else entirely... yet Unity keeps yapping on and on about a compile error in a script that has nothing to do with my current scene. Then you end up commenting out stuff and essentially wasting time trying to fix a script you don't even care about before anything in the entire project will run.

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #3 on: February 01, 2014, 09:49:38 PM »
So I followed the three steps, creating a new scene, deleting the NGui, re-importing. No Love.

I don't ever get the NGui menu or any sign that it is actually able to start running.

For compile errors I now get 'UIPopupList' does not denote a valid type ('not found') and same for "HUDText" which I've deleted and reimported several times as well.

I'm figuring since I have no NGui menu that I'm getting the compiler errors because NGui never really gets installed right so my scripts believe "HUDText" and "UIPopupList" are not valid types.  Naturally I've quit out, re-loaded, even rebooted the computer.
« Last Edit: February 01, 2014, 10:15:00 PM by DuaneDog »

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #4 on: February 01, 2014, 10:16:52 PM »
One more small thing I've noticed. It seems the Javascripts are having more of a problem. My C# scripts seem to have no problem resolving the references.

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #5 on: February 01, 2014, 10:39:35 PM »
It seems that much of the problem in trying to recover this project is that even when I make a new scene... Unity can't stop throwing errors on all the scripts that have absolutely nothing to do with the new scene. Is there perhaps some utility or tool that can allow Unity to stop trying to compile scripts that are already broken so that I can get a new scene going, re-import NGui and then go on from there? It seems NGui can't get installed because all the errors.

My main mistake I believe was that the upgrade with one of my scenes rather than an empty scene. When I deleted NGui it killed the scripts out from under my UI. Even now I have never seen the NGui menu again in this project. I believe that is because Unity won't just worry about the compiler errors in the scene that is open but with any scene in the project. So I have been caught in a big vicious circle.

A screenshot shows you how my scripts in my NGui UI look now in my scenes. Deleting Ngui, re-importing, all that stuff... I think as long as my scene lives in the project with all those compile errors Ngui will never install right.

I expect no matter what it's going to be  alot of work for me to  fix this. My UIHandler script that is in the screenshot attached had a lot of objects tied to it using that drag and drop method. I can't possibly imagine how they will ever get wired back up magically. Across 5 scenes and that is painful. But I now wonder if it is recoverable at all.

Another thing I know for sure from this pain... NEVER ever EVER, use the drag and drop object on to a property thing to build up your system. It's burned me a few times before but if I had used scripts to create my objects and tie them together I probably wouldn't be so worried about how I'll get his all working again. The NGui scripts are one thing but all my custom scripts I had on these same NGui objects seem to somehow get abandoned.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Compile errors after updating NGui and HudText
« Reply #6 on: February 04, 2014, 01:51:25 AM »
Missing script references like that point to a bigger problem that's well known in Unity.

Unity keeps references inside metadata files, which are by default hidden in the library folder. If you copy the Assets folder at any point, the metadata will not be copied with it, and all references will be broken.

You physically have to enable visible metadata files through the Editor settings in order to be able to copy things properly.

If you do happen to start a project with these broken references, and you start from scratch, you may not even realize that there is a problem until you follow the standard upgrading instructions which involve deleting the NGUI folder. At that point proper metadata files will be added, and since your project relies on newly-generated ones, everything will be broken again. Moral of the story -- always follow the same process. Either you do it as NGUI suggests, or you re-do the same thing you did last time (copying the files over).