© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-9720-9_31

31. Building and Selling

Casey Hardman1  
(1)
West Palm Beach, FL, USA
 

With our UI in place, it’s time to hook it up with its functionality, giving our player the ability to build and sell towers. This will teach us how to handle events for our UI to respond to clicks on our buttons. We’ll also be learning how to use a fundamental new type, the Dictionary, which will be a lifesaver for storing and retrieving towers we’ve built.

Events

UI elements that have some form of interaction with the user will have event fields exposed in the Inspector, such as a button having an “OnClick” ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.