- Home /
Question by
machinedude · Jan 13, 2013 at 11:22 PM ·
buttontext
Accessing button text
Hi guys,
Is there anyway to access the text of a button in code?
Thanks :)
Comment
Best Answer
Answer by AlucardJay · Jan 15, 2013 at 05:19 AM
I'm going to assume button means key press. There are 2 ways (that I know of) for detecting what type of key was pressed :
Input.inputString : http://docs.unity3d.com/Documentation/ScriptReference/Input-inputString.html
Event.keyCode : http://docs.unity3d.com/Documentation/ScriptReference/Event-keyCode.html
Answer by Chronos-L · Jan 15, 2013 at 02:17 AM
If you are talking about a GUI button, then GUI.Button reference
Your answer
![](https://koobas.hobune.stream/wayback/20220613090908im_/https://answers.unity.com/themes/thub/images/avi.jpg)