- Home /
Unity 5 UI Button OnClick
I'm sorry if this is covered somewhere else but I can't find it. I am seeing tons of tutorials for Unity 4.6 and some for 5 with the new UI system and the button options look like this in unity:
But when I add a UI button in the canvas I get options like this:
Why does my OnClick look different and how can I use this OnClick? Say I create a function in JS:
function QuitGame(){ Application.Quit(); }
Where can I add this function option to a button? I see how many people do it in the first picture with the tutorials but I don't see my version of the Unity interface being used at all. Is this a Pro vs Private version difference?
Your inspector is in Debug mode. On the top right of the inspector is a small button with a drop-down menu. Select Normal to get to the normal inspector view.
For the tutorials, unity 5 has just whet public so tutorials that use unity 5 are quiet rare at the moment. But the UI has not change much since 4.6 so unity 4.6 UI tutorials should be fine. Unity has some nice tutorials them-self http://unity3d.com/learn/tutorials/modules/beginner/ui
Answer by powersjo · Mar 12, 2015 at 07:06 PM
That was it, wow thanks for the help. From @fffMalzbier
Your inspector is in Debug mode. On the top right of the inspector is a small button with a drop-down menu. Select Normal to get to the normal inspector view.
For the tutorials, unity 5 has just whet public so tutorials that use unity 5 are quiet rare at the moment. But the UI has not change much since 4.6 so unity 4.6 UI tutorials should be fine. Unity has some nice tutorials them-self http://unity3d.com/learn/tutorials/modules/beginner/ui
Answer by mcsfernando10 · Feb 29, 2016 at 11:31 AM
As you see in the image solution is to click on Normal Option Thanks goes to @powersjo
Your answer
Follow this Question
Related Questions
How to trigger a button click from script 3 Answers
Button only works once 1 Answer
Create clickable GameObjects (JS) 1 Answer
Moving Line with Collider 0 Answers