Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: burtonposey on September 21, 2012, 09:21:21 PM

Title: UIToggleButtonInspector.cs errors after updating
Post by: burtonposey 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.
Title: Re: UIToggleButtonInspector.cs errors after updating
Post by: ArenMook 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.
Title: Re: UIToggleButtonInspector.cs errors after updating
Post by: burtonposey 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.
Title: Re: UIToggleButtonInspector.cs errors after updating
Post by: sonicviz 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!
Title: Re: UIToggleButtonInspector.cs errors after updating
Post by: ArenMook on October 01, 2012, 12:00:06 AM
It's now in NGUIEditorTools:

NGUIEditorTools.SpriteField.