- Home /
OnClick, parameter setup in editor becomes null??
Hi all,
I have the following setup, and I simply can't figure out what i'm doing wrong?
When I click the Settings button and trigger the on Click on Menu - Canvas which calls the ShowMenu on the MenuManager, I get a null exception????
Hope someone can see what's wrong with the setup..
Have a nice evening :)
Henning
Changing the Show$$anonymous$$enu $$anonymous$$ethod to take a gameobject as parameter and doing a get Component works. But that's just wrong and shouldn't be necessary, I've see it done in in https://www.youtube.com/watch?v=QxRAIjXdfFU
http://git.ashwanik.in/mainmenusystem/
I've compared my methods to they match. So I figure that it's the setup in the editor? Just can't see it.
[1]: /storage/temp/39206-menuwork.png
Answer by hmortensen2907 · Jan 20, 2015 at 09:42 PM
Hi all,
Ok, so the problem is in the editor! I downloaded the project for https://www.youtube.com/watch?v=QxRAIjXdfFU, as mentioned in the comment, and tested it, and it works... Well that's until I drag the SAME object to the OnClick event as already set. Then it changes from script to GameObject. So it's not me that's nuts ;)
I'll download Patch 4.6.1p4 and see if that solves anything, else I'll make a bug report.
Have a great day everybody. Now, go make games! ;)
Henning
Just Found this...
Guess I'll have to wait for 4.6.2 :/
Your answer
![](https://koobas.hobune.stream/wayback/20220613180915im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Method added on a button click with a delegate is being called twice. 0 Answers
Having issues determining a way to use buttons in a script. 2 Answers
Enabling/Disabling a slider from script 0 Answers
How do change UI.button onclick states(off, editor and runtime, runtime only) via script? 0 Answers
How do I make a function not appear on UnityEvents / Button OnClick lists? 0 Answers