Implementing touch with Input System's Enhanced Touch API
Finish setting up the user interface
The Event Trigger component is wonderful for interacting with all the UI’s events. You’ll use the Event Trigger component to call BuildManager.Build during the PointerDown event. Here’s how to set it up:
Add the BuildManager script as a new component to GameManager.
In the Hierarchy window, go to UI ▸ Icons ▸ Well.
Click Add Component and search for Event Trigger.
Then click Add Event Type and choose PointerDown.
Click the + button to add a new item to the list.
Set the GameObjectreference to GameManager.
Change the No Function drop down to InputManager ▸ StartBuildOnPointerDown.
Set the parameter that appears to the Well prefab.
Repeat for the WoodCutterLodge game object. Make sure to set the parameter to the WoodCutterLodge prefab instead.
That’s it for the initial set of build logic. Run the project and try building. You’ll notice a sneaky little bug or two.