Accessing button text

Hi guys,

Is there anyway to access the text of a button in code?

Thanks :slight_smile:

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 : Unity - Scripting API: Input.inputString

Event.keyCode : Unity - Scripting API: Event.keyCode

If you are talking about a GUI button, then GUI.Button reference