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 C# input class


The very first step is to create the C# class that will calculate the input from the player. To start, open Unity with the following steps:

  1. Right-click on the Assets folder and select Create and then Folder:

  2. I named my folder Scripts; you can give it any name you like, although I recommend something that keeps you organized.

  3. When this folder is created, right-click on it. Then, navigate to Create and select C# Class.

  4. You can again name this what you like; I chose PlayerInput.

Unity ships with its own Integrated Development Environment (IDE) called MonoDevelop. When you double-click on PlayerInput, this is what will open.

Tip

If you want to use a different IDE, you can do so by navigating to Edit | Preferences | External Tools and changing External Script Editor to something of your choice.

Now, double-click on PlayerInput.

When PlayerInput opens, it will have a default structure that Unity uses for classes created in the engine, as shown in the following code:

using UnityEngine...