x


Onclick function?

Does Unity have an Onclick type function for game menus?

more ▼

asked May 10, 2010 at 09:44 PM

maesterghaleon gravatar image

maesterghaleon
16 1 2 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Yes, there are several options. You could use the GUI 2.0 scripting interface which automatically handles input. Found here.

Or you can use GUITextures and then use OnMouseDown() in a script to act as a button click. Found here and here.

Both have their advantages. GUI 2.0 is slightly easier, because it takes care of most of the input handling, but GUITextures would allow you to be very precise and have more control over the button/ menu.

more ▼

answered May 10, 2010 at 10:10 PM

Peter G gravatar image

Peter G
17.7k 30 65 164

Any luck? Remember to select an answer as the right one so the next person to see this question knows how to solve the problem.

May 12, 2010 at 11:07 PM Peter G

I'll upvote it - good luck getting a checkmark. :)

May 25, 2010 at 10:49 PM Cyclops

Thanks :) [Space Filler. Gotta get to 15 chars.]

May 26, 2010 at 12:37 PM Peter G
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x18

asked: May 10, 2010 at 09:44 PM

Seen: 17492 times

Last Updated: May 10, 2010 at 09:44 PM