Welcome,
Guest
. Please
login
or
register
.
October 29, 2025, 10:36:35 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set bool OnClick using Notify not working
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set bool OnClick using Notify not working (Read 3399 times)
will_brett
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 40
Set bool OnClick using Notify not working
«
on:
April 21, 2014, 08:09:35 AM »
Hey all,
This is probably something really obvious and Im just being a bit thick but I can not get it to work,
I have a GUI button that has a gameobject attached to the Notify part. This triggers the Function MyClickFunction() and it SHOULD change the bool from false to true but it does not. However the Debug.Log is posting so I know its running the function.
Any ideas? Here is the script
public
class
ButtonClickTrigger
:
BaseTrigger
{
public
bool
_buttonPressed
=
false
;
public
void
MyClickFunction
(
)
{
_buttonPressed
=
true
;
Debug
.
Log
(
"Button Was clicked"
)
;
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Set bool OnClick using Notify not working
«
Reply #1 on:
April 22, 2014, 04:16:12 AM »
If you see the Debug.Log, then it most certainly changes the value of your bool. Try printing it out in place of your Debug.Log, and print NGUITools.GetHierarchy(gameObject) as well to make sure you're targeting the right object.
Logged
will_brett
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 40
Re: Set bool OnClick using Notify not working
«
Reply #2 on:
April 22, 2014, 05:43:26 AM »
Thanks Aren, I will try this later today
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set bool OnClick using Notify not working