Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Button's events
« previous
next »
Print
Pages: [
1
]
Author
Topic: Button's events (Read 4606 times)
hromoydron
2D Toolkit
Newbie
Posts: 28
Button's events
«
on:
June 29, 2013, 08:39:57 pm »
I make a script and attach it to button:
Code:
[Select]
void OnClick()
{
Debug.Log("tada");
}
but nothing happens, why?))
Logged
hromoydron
2D Toolkit
Newbie
Posts: 28
Re: Button's events
«
Reply #1 on:
June 29, 2013, 08:55:16 pm »
or I should do like this:
Code:
[Select]
this.OnClick += ButtonClick;
but unity want definition for OnClick
?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Button's events
«
Reply #2 on:
June 29, 2013, 09:16:33 pm »
The UI system uses .net events. You should read up some basics about how that works. If you want an example of it set up, look in tk2dUIDemoController.cs - there are a few examples of buttons being used there.
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Button's events