Welcome,
Guest
. Please
login
or
register
.
September 16, 2024, 07:47:42 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Group of UIToggles error
« previous
next »
Print
Pages: [
1
]
Author
Topic: Group of UIToggles error (Read 1301 times)
elvess
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 44
Group of UIToggles error
«
on:
August 28, 2014, 02:57:26 AM »
Hello. I have a group of UIToggle. This is 5 separate UIToggles and 1 - Check All Toggle. When I check Check All Toggle it should do something like:
foreach (PlayerItem item in m_PlayersList)
{
if (!item.IsChecked)
item.SelectPlayerToggle.value = true;
}
There is OnValueChange event on item.SelectPlayerToggle. But I receive an error on the first iteration
Object reference not set to an instance of an object UIToggledObjects.Toggle () (at Assets/NGUI/Scripts/Interaction/UIToggledObjects.cs:49) - bool val = UIToggle.current.value;
Is there a way to do this by code?
Thank U
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Group of UIToggles error
«
Reply #1 on:
August 28, 2014, 09:08:02 PM »
How are you getting the UIToggledObjects.Toggle to trigger with UIToggle.current being null? That function is called by UIToggle's onChange notification, which is wrapped inside "current = this" section. What version of NGUI are you using?
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Group of UIToggles error