We can now tell the button to call our event handlers when events occur:
- On the Button, go to Add Component | Event | Event Trigger.
- Press Add New Event Type | PointerDown.
- In the Pointer Down list, press the plus icon, then drag GameController from Hierarchy onto the Object slot.
- Now in the function list (presently says No Function), select MasterControls | SlowTime().
Repeat this for a PointerUp event:
- Press Add New Event Type | PointerUp.
- Press the plus icon, then drag GameController onto the Object slot.
- Now in the function list, select MasterControls | ResetTime().
Event triggers should look as follows:
Save the ...