- Home /
Question by
inviasubito · Aug 15, 2016 at 02:41 PM ·
uibuttonclick
AddListener not working c#
Hi, i have this metod:
void Create()
{
Button but = go.AddComponent<Button>();
but.transition = Selectable.Transition.SpriteSwap;
but.spriteState = st;
//action
UnityEngine.Events.UnityAction Action = () => { print("hi"); };
but.onClick.AddListener(Action);
}
But it doesn't work when I click why?
Comment
Your answer
Follow this Question
Related Questions
Only want to detect button click event 1 Answer
How do I make a UI button to click a key? 1 Answer
How to use button multiple times 1 Answer
Detect UI Button Click Event in Update method 3 Answers
Unity UI Button not working 1 Answer