Author Topic: After upgrading to 3 - all my script references to UI buttons are missing  (Read 2904 times)

humaliens

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
I read to try to delete the Unity Library folder - tried this didn't help. Would upgrading to pro fix this type of issue. I have over 300 script calls on buttons in our project and it's a long process to have to go back and drag an drop all these again.

Let me know if there's something I'm doing wrong on upgrading.

Using the normal method as always:

1) Create new scene
2) Delete NGUI Folder
3) Update and Import NGUI 3 from Asset Store
4) Double click 3.0 package - all this works fine

references on buttons and other objects missing scripts

Thanks

OnlineCop

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: After upgrading to 3 - all my script references to UI buttons are missing
« Reply #1 on: September 26, 2013, 06:29:51 PM »
With 300 prefabs to go through, you may find it more useful to keep with 2.7.x. However, there is a fix to this, if you have a few things in Unity enabled:
Edit->Project Settings->Editor should let you choose 'Version Control: Meta' and 'Asset Serialization Mode: Force Text'
Having meta files generates gives you the flexibility to see the internally-generated GUIDs. UIButton.cs and UIImageButton.cs both create a .meta file, and if you look at their respective UIButton.cs.meta and UIImageButton.cs.meta files, they have a GUID in the YAML file. You can search through all of your .prefab and .unity files for the old GUID value for UIButton/UIImageButton, and replace them with the GUID of these new ones, and it will fix the 'broken' links.
This is certainly not ideal, but it might be faster to do a massive search-and-replace through all your files than to manually reattach everything.
Is there a reason you need to upgrade your project at this stage of development, though? Does 3.x do anything that you need which 2.7.x doesn't fulfill for you?

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
Re: After upgrading to 3 - all my script references to UI buttons are missing
« Reply #2 on: September 26, 2013, 06:35:25 PM »
Did you also happen to do the step mentioned where you create each prefab as an object, make sure it's enabled, then save the object/apply changes?

The upgrade doesn't affect prefabs, or disabled objects. 


humaliens

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: After upgrading to 3 - all my script references to UI buttons are missing
« Reply #3 on: September 26, 2013, 08:20:59 PM »
Thanks, will try GUILD META FILE fix.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: After upgrading to 3 - all my script references to UI buttons are missing
« Reply #4 on: September 27, 2013, 06:11:52 PM »
Just a note, missing references like that are generally caused by copying NGUI from one project to another without also including metadata files. Then when upgrading from a package, NGUI replaces files with correct GUIDs, however since you were referencing incorrect ones, you've got a problem.