Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: lastkingssaint on November 29, 2016, 11:17:49 PM

Title: Grid multiselect
Post by: lastkingssaint on November 29, 2016, 11:17:49 PM
Hello, quick question,

Is there a way to have a grid with multiselect for the items within it? Is there preexisting functionality or do i have to build a script for it from scratch.?

My idea is to have like a 20 item grid, and then allow the user to select up to 5 at a time and then i will do something with that list.
Title: Re: Grid multiselect
Post by: ArenMook on November 30, 2016, 03:29:03 PM
How would that be different from just having a bunch of toggles?
Title: Re: Grid multiselect
Post by: lastkingssaint on November 30, 2016, 07:49:21 PM
You are correct, it is not different. Just started using toggles today.
I see that you can iterate through the toggle list to get all toggles. Is there a way to limit them for example if I want you to only be able to select 5 toggles max out of a list of 10. Do i need a toggle group to stop me from toggling the 6th item
Title: Re: Grid multiselect
Post by: ArenMook on December 02, 2016, 12:54:41 AM
It's pretty much up to you. Create a script that references your list of toggles. Assign an OnChange delegate to each, inside this delegate check to see how many are toggled. If more than 5, change the value back.