uGUI Button - wire up the click...?

Hello,

I’m working on my LD48 entry and am trying to figure out how to wire up the click handler for the new uGUI stuff.

Any tutorials out there? I’m not quite following the process.

Thanks,
~David

One of the simplest ways is to just add a new MonoBehaviour with an OnClick() method. Add this component to a gameobject, hook it up to the On Click() under the button.

Example:

public class Click : MonoBehaviour
{
   public void OnClick()
   {
      Debug.Log("Click!");
   }
}

The script is just added to the button itself.

I can’t get it to let me use the same script but a different button with a different function.