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:
- In the
Project
window, create aC# Script
in your scripts folder (Assets/HowToChangeATire/Scripts/
) and name itInstructionsController
. - In
Hierarchy
, selectCreate Empty
object. - Rename it
Game Controller
. - Drag the
InstructionsController
script intoInspector
, 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
for editing and write the following:
File: InstructionsController.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class InstructionsController : MonoBehaviour { public Text...