Creating the interaction modes behavior
When the app enables a mode, it will enable the corresponding game object, which has a script that controls the behavior of that mode. When the app changes modes, the current mode object will be disabled, and the new one enabled. Each mode is responsible for the following:
- Displaying its corresponding UI
- Transitioning to a different mode when specific conditions are met
We will write mode scripts for each of the modes.
The StartupMode script
Startup mode begins when the application starts (it's enabled from the InteractionController
Start()
function). It displays the Startup UI panel. Then it waits for the ARSession
state to become ready, and transitions to Scan mode. Or, if the ARSession
reports that AR is not supported on the current device, it transitions to NonAR mode.
Follow these steps to create Startup mode:
- Create a new script in your Project
Scripts/
folder by right-clicking and selecting Create...