Welcome,
Guest
. Please
login
or
register
.
July 18, 2025, 08:53:30 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How do I send an event to another object using the new EventDelegate system?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How do I send an event to another object using the new EventDelegate system? (Read 2178 times)
aikitect
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 27
How do I send an event to another object using the new EventDelegate system?
«
on:
December 27, 2013, 11:41:52 AM »
In NGUI <2.7, I was able to set an eventReceiver for UICheckbox to send an event to another object within my scene.
For example, I have the code:
checkbox
.
eventReceiver
=
GameObject
.
FindWithTag
(
"Model"
)
How do I do this with the new EventDelegate model in NGUI 3?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How do I send an event to another object using the new EventDelegate system?
«
Reply #1 on:
December 27, 2013, 03:59:58 PM »
EventDelegate.Add(checkbox.onChange, YourFunction);
Logged
aikitect
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 27
Re: How do I send an event to another object using the new EventDelegate system?
«
Reply #2 on:
January 25, 2014, 01:56:04 PM »
So what exactly goes into "YourFunction"? So for example, my GameObject is called "Model", and the script that is attached is "Controller", and the function within "Controller" that I want to call is "UpdatePoints".
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How do I send an event to another object using the new EventDelegate system?
«
Reply #3 on:
January 25, 2014, 03:59:44 PM »
EventDelegate
.
Add
(
checkbox
.
onChange
, UpdatePoints
)
;
void
UpdatePoints
(
)
{
Debug
.
Log
(
UIToggle
.
current
.
name
+
" state: "
+
UIToggle
.
current
.
value
)
;
}
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How do I send an event to another object using the new EventDelegate system?