Author Topic: UIToggleButtonInspector.cs errors after updating  (Read 4697 times)

burtonposey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
UIToggleButtonInspector.cs errors after updating
« on: September 21, 2012, 09:21:21 PM »
Greetings,

I just updated my NGUI as was greeted with the following error:
Quote
Assets/NGUI/Scripts/Editor/UIToggleButtonInspector.cs(48,63): error CS0117: `UISpriteInspector' does not contain a definition for `SpriteField'

What I've noticed is that the latest version doesn't have this function, but the old one did. I also noticed that UIToggleButtonInspector wasn't in the package to update, so I'm not sure what the deal is. I tried trashing UIToggleButtonInspector from my project to see if I could force the package importer to make it come in anew with the latest version, but I do not see it in the import dialog's hierarchy.

I did solve my issue in a less than ideal manner by dumping the UIToggleButtonInspector script.

I'd love some help with this. I haven't had this much trouble in the past getting the new versions integrated. Perhaps I should have started from scratch? Thanks for any and all help.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggleButtonInspector.cs errors after updating
« Reply #1 on: September 21, 2012, 11:01:24 PM »
UIToggleButton is a script you got somewhere on this forum. It's not a part of NGUI.

burtonposey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: UIToggleButtonInspector.cs errors after updating
« Reply #2 on: September 21, 2012, 11:06:00 PM »
Awesome. Thanks for the reply. I can rest easy I'm not breaking the codebase.

Only other stuff I carry over from version to version is changing a lot of your private stuff to protected so I can actually override some of the classes.

Thanks again.

sonicviz

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 58
    • View Profile
Re: UIToggleButtonInspector.cs errors after updating
« Reply #3 on: September 30, 2012, 11:28:58 PM »
I just hit this as well, I use the forum togglebutton as one did not exist in NGui.

UISpriteInspector is now missing the following code:
  1.         /// <summary>
  2.         /// Convenience function that displays a list of sprites and returns the selected value.
  3.         /// </summary>
  4.  
  5.         static public string SpriteField (UIAtlas atlas, string field, string name, params GUILayoutOption[] options)
  6.         {
  7.                 List<string> sprites = atlas.GetListOfSprites();
  8.                 return (sprites != null && sprites.Count > 0) ? NGUIEditorTools.DrawList(field, sprites.ToArray(), name, options) : null;
  9.         }
  10.  
  11.         /// <summary>
  12.         /// Convenience function that displays a list of sprites and returns the selected value.
  13.         /// </summary>
  14.  
  15.         static public string SpriteField (UIAtlas atlas, string name, params GUILayoutOption[] options)
  16.         {
  17.                 return SpriteField(atlas, "Sprite", name, options);
  18.         }
  19.  

Could I ask why it's gone?
What is it replaced with?

I need the toggle button, unless NGui has an inbuilt now?

ty!
« Last Edit: September 30, 2012, 11:41:08 PM by sonicviz »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggleButtonInspector.cs errors after updating
« Reply #4 on: October 01, 2012, 12:00:06 AM »
It's now in NGUIEditorTools:

NGUIEditorTools.SpriteField.