Adding interactivity to our AR menu application
To infuse life into our currently modest AR scene, we must incorporate some C# scripts into our project. This key step will empower the users of our AR app, allowing them to interact with our imported food prefabs dynamically and engagingly.
In the next section, you will get an overview of the short but decisive Food script.
Adding the Food script to the scene
Before we dive into scripting, let’s first organize our project workspace so that we can work more efficiently by finding the needed components quickly.
Start by adding a new folder to the Assets
directory in the Project window. Simply right-click and select Create | Folder. Rename this folder Scripts
and enter it. Right-click in this empty folder and select Create | C# Script to create a script called Food
. After double-clicking on this script, it should be opened in your preferred integrated development environment (IDE).
The Food script defines a custom...