O'Reilly logo

Learning Unity iOS Game Development by Kyle Langley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the game user interface

To begin with the user interface for our game, we need a class that manages when and how to use UI elements, such as buttons and when to show the UI screen.

The GameInfo class

In order for our other code classes to get a reference to the GameInfo class, we can create a GameObject in the scene that holds a GameInfo script component. To do this, perform the following steps:

  1. In the Assets/Scripts folder, right-click and select Create and then click on C# Script. Name this GameInfo.
  2. Double-click on the GameInfo script and select the Start function as Awake. Save this file and go back to Unity.
  3. Right-click on Hierarchy and select Create Empty. Name this new GameObject GameInfo.
  4. With this selected, search for Inspector and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required