Author Topic: Upgrade problems.  (Read 8610 times)

fwalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Upgrade problems.
« on: March 24, 2013, 09:34:50 PM »
I am trying to upgrade to 2.5.0c.
There is a catch to our setup. We moved the location of NGUI from Assets to Asstes\External. Not sure if that is the root of my problem.
I follow the following steps:
1. Create a New Scene
2. Delete NGUI foilder under Assets\External from Project tab
3. Import the new NGUI which imports to Assets
4. From Porject Explorer move NGUI from Assets to Assets\External

I have also tried not doing step 4.

No matter what I try when I exit the current new scene and go to my scenes every single reference to any NGUI controls is gone and I get the dreaded "Missing Mono Script" and no way to figure out what it is looking for?
Has anyone seen this before?
I am running Unity 4.1.1f4
Thanks

adam718

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: Upgrade problems.
« Reply #1 on: March 24, 2013, 10:13:48 PM »
In your original project, NGUI must be in Assets.

1. before importing ngui, you should move ngui from Assets/External first.
2. import NGUI.
3. if you really want NGUI to be in Assets/Externals, now move it. (it is not recommended)

fwalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Upgrade problems.
« Reply #2 on: March 25, 2013, 08:26:01 PM »
Thank you Adam,

I did not think of that. And I thought it would definitely work. Unfortunately I had no luck.
This is what I did in more detail.

1. Move NGUI to the Assets folder from Assets/External
2. Verify that everything still looks good in my Scenes. And it does.
3. Create a new Scene
4. Delete the NGUI folder (now in Assets)
5. Import the new NGUI to Assets folder of course.
6. Go back to one of my project scenes
(At this point the references have again been lost :( )...

That should have work, I would have thought.
Frustrating....

Out of curiosity, Why is it not a good idea to move NGUI to Assets/External? :(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Upgrade problems.
« Reply #3 on: March 25, 2013, 08:33:09 PM »
You need to start a new scene before importing NGUI.

fwalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Upgrade problems.
« Reply #4 on: March 25, 2013, 08:35:39 PM »
But I did.
Step number 3?? No?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Upgrade problems.
« Reply #5 on: March 25, 2013, 08:40:03 PM »
Then yes, it should work.

My guess -- and it's just a guess -- is that you moved NGUI into the Assets Folder outside of Unity, without copying the associated metadata. This completely breaks all references to all existing examples. If you then made a UI like that, your UI will only work with the mis-referenced version.

To check, simply import NGUI's examples. If they work, then that's exactly the issue.

fwalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Upgrade problems.
« Reply #6 on: March 26, 2013, 08:33:06 PM »
Well, you are right about the examples working correctly!
But I am following the instructions and doing everything through the project panel.
I learned the lesson about touching files from outside Unity the hardway :)

I am totally lost about what else I can try.
Our project in under source control with Perforce. And I know Perforce and meta files don't care for each other too much.

I even went as far as.
Making the move for NGUI from Assets/External to Assets. Verifying everything worked properly submitting the project to perforce, ensuring the changes worked fine on other computer. Then getting a brand new clean project from perforce and just following the upgrade instructions to the letter.

1. Make a new scene
2. Delete NGUI from the Assets folder.
3. Import the new NGUI package.

If I try the examples on NGUI everything is awesome.
If I try an atlas from my project in the new scene the Atlases are not recognized by the NGUI widget.

I really need to upgrade NGUI as there is a fix that we need for sure.
I am running Unity 4.1.0 I am sure this upgrade process has been test with that version of Unity correct?
Any other crazy ideas I can try. Like delete .meta and recreate some how?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Upgrade problems.
« Reply #7 on: March 26, 2013, 11:36:37 PM »
Unity references scripts not by their name, but by an internal ID number. This ID is stored in the .meta files. If you move or copy the script file, but not the meta file, Unity will generate a new ID for it, which means that all the objects referencing this script will no longer be able to find it.

That's what happened in your case. At some point in your development cycle you moved the NGUI files without the associated meta file -- which only happens if you do it from windows explorer / mac OS finder. Doing it from within Unity always works correctly.

There is no easy fix for this. That's just how Unity works. You made a mistake, and now your project is referencing the wrong IDs. Your options are either to do everything properly from this point onward (and re-create your UI), or to continue living with a completely new set of IDs. If you want the latter, you want to create a new project, import NGUI, then copy NGUI's files (BUT NOT THE METADATA) to your project, overwriting what's there.

Doing so will cause the NGUI's examples to no longer work, but your project should work fine. Also keep in mind that doing this means you have to follow the same process every time you update, as it's the only way to keep the broken IDs the same.

fwalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Upgrade problems.
« Reply #8 on: March 27, 2013, 08:14:52 AM »
Ah ha,

Thank you for the awesome explanation and taking the time. I get it now.
I think it might be time to get things right before we get a snow ball effect from this.

Again thank you. Much appreciated !