Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: wallabie on June 12, 2014, 12:56:00 AM
-
I lost a some time trying to figure out why the toggle wasn't being a set in code.
if (group == 0 || value || optionCanBeNone || !mStarted)
My situation is :
group = 5
value = false
optionCanBeNone = false
mStarted = true
-
The way it is now is intentional. When in a group, you should not be setting toggles to 'false' state. You should instead be setting a single toggle to 'true' state, and it will take care of setting other toggles to 'false' automatically.
When "option can be none" is off, you can't turn off the active toggle. One toggle must always be active in a group.
-
I need to set this to false to get around the bug in the Accordion nested scrollView problem.
The problem is that NGUI BetterList only works for enabled children, so when one of the child toggle is not active, it will not change the state of that child.
This is what happens when the accordion header is collapsed, the child inside is not visible to the BetterList. If you could fix the bug then I will not need to set the toggle to false.
-
That's not a bug. When a game object is disabled, it effectively doesn't exist as a part of the scene. It wouldn't make sense to keep references to scripts on disabled objects. As I mentioned in the other thread, you need to use unique groups instead of having all your toggles share the same group ID.