App state manager

We are going to add an AppStateManager to the project. Let's begin by making the object and then write the component script:

  1. In the root of the Hierarchy, create an empty game object, and name it AppStateManager.
  2. In the Scripts folder create a new C# script named AppStateManager and drag it onto AppStateManager as a component.

Open the AppStateManager script for editing, as follows:

File: AppStateManager.cs

First, we'll declare the appState and a large set of public variables that will be explained as we use them:

using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using Vuforia; public class AppStateManager : MonoBehaviour { private AppStates appState; //Vuforia scripts that are used to get the state ...

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.