Creating an Instructions Controller

We're now going to create a controller object and script for our project. This first implementation will be relatively simplistic. It will grow and improve later in the chapter. In Unity, perform the following:

  1. In the Project window, create a C# Script in your scripts folder (Assets/HowToChangeATire/Scripts/) and name it InstructionsController.
  2. In Hierarchy, select Create Empty object.
  3. Rename it Game Controller.
  4. Drag the InstructionsController script into Inspector, adding it as a component.

Save the scene and then open the script for editing. Like most Unity scripts, this class will be derived from MonoBehaviour. We write a couple of functions required to update the UI based on user input. Open InstructionsController.cs ...

Get Augmented Reality for Developers 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.