Author Topic: UIToggle trouble after upgrade.  (Read 7728 times)

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
UIToggle trouble after upgrade.
« on: October 23, 2014, 09:47:53 PM »
I just upgraded to 3.7.4 from 3.0.8 and UIToggle is broken. I have 6 UIToggles in group 1. And only one has the Starting State checked. But all the toggles are active. If I run the project it the same, all the toggles are checked. If I manually click to uncheck all of them I can end up with only one active and checked from which point the Toggles start working correctly as before.  What changed and how do I fix it.

Also what is the "State of 'None'" option for? Of course I read the documentation but I can't understand what this means. How can it be 'none'? It is either checked or not checked.

bool UIToggle.optionCanBeNone = false
Can the radio button option be 'none'?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #1 on: October 25, 2014, 02:02:26 PM »
Yes, radio button option can be none. For example, a multiple choice question that begins with no selection, or a group where "no selection" is also a valid selection.

Toggles haven't changed in like a year, I honestly don't remember what would be different. 3.0.8 is extremely out of date. I wish you had kept up with the updates a little more frequently. I do remember that the "startsChecked" is what the variable was before, and now it's "startsActive". Perhaps all you need to do is to ensure that all your toggles are using the updated field by checking and unchecking the state in inspector and re-saving the prefab.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #2 on: October 25, 2014, 03:12:34 PM »
When the game is running I can toggle them all off and get just one turned on and then they work as they should...as long as I don'T quit the game. But when I quit and restart they are screwed up again. So it is not an operation issue, it is a startup/initialization issue. In the Editor, all 6 toggles are in the same group and only one has the 'Starting State' checked. And even when I run the game in the editor I can see that only one has the Starting State checked, but all toggles look as if they are selected/on.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #3 on: October 25, 2014, 03:14:44 PM »
Put some debug code in the function that toggles them on and see where it's getting called from.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #4 on: October 25, 2014, 03:24:18 PM »
Thanks but how in a function do you see what is calling it or where it is being called from?

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #5 on: October 25, 2014, 03:26:54 PM »
Also, after upgrading should I have run any upgrade scripts?

I see 'NGUI Upgrade Tools' in my project but I thought that is for upgrading from 2 to 3.

I did do an 'Upgrade Widgets'.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #6 on: October 25, 2014, 03:35:41 PM »
I just upgraded to 3.7.5. Anyway problems like this are the very reason I didn't upgrade. Upgrades always break things. Also I appreciate your support and constant improvements. But there are just too many updates coming out too fast. I can see once or twice a year but more than that is just too much.
« Last Edit: October 25, 2014, 03:49:44 PM by TokyoDan »

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #7 on: October 25, 2014, 08:01:03 PM »
Aren, Just to let you know...I fixed it. When I upgraded from 3.0.8 I followed the instructions about creating a new scene and deleting the NGUI asset in the Project panel, then importing the new version. But...

When I imported I intentionally (and stupidly forgot that I was using stuff from them) didn't import the Examples. This means that my toggles didn't have the Checkmark animation that is required.

To fix I imported just the examples, and dropped the Checkmark animation back into Animation slot of the Animation component of my checkmark object, then re-dropped my checkmark object back into the UIToggle Animation slot.

I am very sorry for wasting you time, but your help did point me in the right direction.
Thanks again.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #8 on: October 31, 2014, 08:53:56 PM »
I hit another problem after upgrade. It is with (vertical) UIScrollView Lists. Before when I dragged a list up or down the items in the list would be clipped to the window, now they are not clipped. What changes in the newer versions could cause that?

(I did a side-by-side check of all the settings between the old working version and the new bad version and all the settings are the same.)

My List hierarchy is:

AIListRoot (simple game object as parent)
   AIList (UIPanel and UIScrollView components)
       Grid (UIGrid)
          Item1 (UIDragScrollView, Box Collider components)
                BackGround (UISprite)
          Item2 (UIDragScrollView, Box Collider components)
                BackGround (UISprite)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #9 on: November 01, 2014, 08:07:43 AM »
Clipping won't work if:
1. Quality settings are set to Fastest, thus disabling shaders. Changing quality settings to something else is the fix.
2. Shaders that come with NGUI are missing, can't be loaded, or have wrong names. Importing NGUI into a clean project and/or following upgrade instructions is the fix.
3. The atlas used by the widgets is not using an NGUI shader. For example Unlit/Transparent is not an NGUI shader. Unlit/Transparent Colored is.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #10 on: November 01, 2014, 08:05:23 PM »
as for 1. What Quality Settings are you referring to? Where are they?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #11 on: November 02, 2014, 04:06:33 AM »
Consult Unity's documentation on Quality Settings: http://docs.unity3d.com/Manual/class-QualitySettings.html

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIToggle trouble after upgrade.
« Reply #12 on: November 02, 2014, 06:43:23 AM »
Oh. Those (which I haven't changed). I thought you were referring to a NGUI setting.

Thanks again.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: UIScroll View trouble after upgrade.
« Reply #13 on: November 02, 2014, 08:50:09 PM »
I found out what the problem was. In the UIScrollView UIPanel component the Clipping was blank. Not 'None' or any other setting but completely blank. This happened on upgrade and I followed the proper upgrade instructions. I made a new scene, deleted the NGUI folder, then re-imported the latest NGUI. I guess due to my not completely standard NGUI hierarchy that Clipping setting didn't get set to "Soft Clip" as it should have.