Question by
ArchanaVelu06 · Oct 29, 2019 at 09:47 AM ·
uicustom
Button with custom function working perfectly in unity editor but, not working in mac build ??
I have a button with a custom function which is working perfectly in unity editor. But when I take a mac build they don't call the assigned function onClick. Can anyone please help me fix this issue ?
Comment
Can we have a look at your code? It's kinda abstract and hard to tell where the problem is.
Anyway here is how I add custom functions at runtime. Tested on Win/Linux/$$anonymous$$acOS/Android/iOS
public Button myBtn;
private void Start()
{
myBtn.onClick.AddListener(()=>CustomFunc());
}
public void CustomFunc()
{
Debug.Log("A custom function that was added at runtime to the button onClick");
}
Your answer

Follow this Question
Related Questions
How do I apply a mask to a slider fill so it uses my quadrilateral design 0 Answers
UI bug, some boxes appear when I click on an item 0 Answers
How do you access the text value of the Dropdown UI? 6 Answers
GUI on a secondary display 0 Answers
Force a uGUI scrollbar/scrollrect to stay at the bottom when the scrollrect is expanded 0 Answers