Book Image

Learning Unity iOS Game Development

Book Image

Learning Unity iOS Game Development

Overview of this book

Table of Contents (14 chapters)
Learning Unity iOS Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
6
Main Menu, iAds, Leaderboards, Store Purchases, and Achievements
Index

Creating the Input GameObject


Save the document and then maximize or select Unity. This will force the editor to compile the code that we have just written.

  1. On the left-hand side of the editor in the Hierarchy tab, right-click and select Create Empty. This will add a blank GameObject to the scene.

  2. Right-click on the GameObject that we just created and select Rename. Name it Input.

  3. While still having the Input GameObject selected, look to the right-hand side of the screen in Inspector and click on Add Component.

  4. When the search window pops up, enter the first half of what you called your input class. For example, when I enter player, my Player Input class will appear in the list:

  5. Click on your input class to add it to the Input GameObject. If everything goes according to plan, you will see the component added and SwipeTime and SwipeDistance both set to 0. Alternatively, you can add the Input component to GameObject by left-clicking, holding, and dragging it onto GameObject in the Hierarchy tab...