Just create a function in the script that is attached to the button Game object. For example like this:
void OnClick ()
{
//Do stuff
}
That function will be called every time the button is pressed.
↧