Author Topic: Feature Request: UICheckbox group, similar to UIButtonTween's "tweenGroup"  (Read 1941 times)

Baroni

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Good morning Aren,

please consider adding a group variable to the UICheckbox component, just as in UIButtonTween and its tweenGroup variable.
From the documentation: "If there are multiple tweens, you can choose which ones get activated by changing their group.". I would like to use this behavior for checkboxes too, so I can specify a group of checkboxes under the same parent.

My use case:

Each one of my prefabs has multiple checkboxes and they all share the same parent (radio button root). My hierarchy looks like this:

Panel (radio button root)
- Item 1
--- checkbox 1
--- checkbox 2
- Item 2
--- checkbox 1
--- checkbox 2

Desired behavior: checkbox 1 of Item 1 should be associated with checkbox 1 of Item 2. If I click on checkbox 1, it should send its state change to other checkboxes within the same group (1).
Current behavior: clicking on a checkbox sends a state change notification to all other checkboxes, be it checkbox 1 or 2. That's because they share the same radio button root. I instantiate the prefabs at runtime, re-parenting them to other transforms would be a mess, to say the least.

I am developing a package for the Asset Store that will require the paid version of NGUI, therefore I can't implement and distribute, as per license, a modified UICheckbox component in my package.

Thank you so much for your efforts and your consideration!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
This is a good suggestion, and it actually matches what I did myself for the upcoming built-in GUI solution. Instead of specifying a common root, you will just specify a group ID.

iamdain

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Feature Request: UICheckbox group, similar to UIButtonTween's "tweenGroup"
« Reply #2 on: November 03, 2013, 11:09:31 PM »
Hi I just upgraded a project to the new version with this and just want to clarify from the wording of the update notes as I use a lot of these.

Do the groupings refer only to the checkboxes with a common parent? So if I have two separate objects each containing checkboxes and the boxes in each are set to group 1, they will be treated as being separate to each other with regards to toggling / radio button behaviour?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Feature Request: UICheckbox group, similar to UIButtonTween's "tweenGroup"
« Reply #3 on: November 04, 2013, 12:22:04 PM »
There is no common parent logic anymore with toggles. Only group ID, which affects all active toggles.