- Home /
Question by
SUpersindit2 · Oct 18, 2015 at 06:18 AM ·
uibutton
Creating a UI button.buttonclickedevent manually
i have tried using items.GetComponent<Button>().onClick.AddListener(delegate { ShopBuyItems(x); });
to create a listener for the callback of shopbuyitems method which takes in a parameter of an interger where items is a gameobject that is instantiated to a UI panel with a grid layout attached to it. I could not make it so that it when we click on the button, it will call the shopbuyitem method.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612041734im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Button on Panel is not responding 1 Answer
RPG Maker style menu with UI buttons that are selected by controller 0 Answers
UI Button Event Trigger Update Selected not working 0 Answers
UI Button Set Image 1 Answer
UI Button ON/Off 3 Answers