Building the Main mode and menu
In this section, we will set up the main mode app to handle user interactions, including face filter selections from a main menu. To do this, we first need to create a changeable face prefab that can be told which facial features to display. We'll write a FaceMainMode
script that displays the main UI panel and passes change requests from the user to the face object. Then, we'll make a main menu with a set of horizontally scrolling buttons that the user can tap to change face filters.
Creating a changeable face prefab
To create a face prefab that we can use for dynamically changing filters during runtime, we'll start with an empty game object with an AR Face component, and add a script for setting the contained prefab object. Use the following steps:
- In the Project window, right-click in your
Prefabs/
folder and choose Create | Prefab. Rename itChangeable Face Prefab
. - Click Open Prefab to begin editing.
- With the...