The InstructionsController will handle the AR and anchor modes for the app. Now we'll edit the InstructionsController script (component of Game Controller in the scene). Open the script for editing and change it as follows:
File: InstructionsController.cs
At the top of the class, add the following public and private variables:
public GameObject standardContent; private bool arMode; public GameObject anchorButton; public GameObject arPrompt; private bool anchorMode;
Add the following methods to toggle the AR mode:
public void ToggleAr() { arMode = !arMode; if (arMode) { TurnOnArMode(); } else { TurnOffArMode(); } } void TurnOnArMode() { standardContent.SetActive(false); TurnOffAnchorMode(); } void TurnOffArMode() ...