QuickMenu & MiniLauncher
Last updated: 1 year ago | Visibility: Public
Prerequisites
- Unity 2020.3.x (with Android Build support)
- OpenXR (1.5+)
- Lynx Core
- Lynx Modules
- TextMeshPro
Context
The QuickMenu & MiniLauncher are the UI elements designed to allow users to interact with the Lynx OS from within XR applications in a streamlined way.
The QuickMenu allows to access common system actions (ex : screenshot, volume control, AR toggle etc) through an easy one-handed gesture.
The MiniLauncher, accessed from the QuickMenu, is a simplified Launcher interface allowing to check on system information (time, battery, currently running app etc). It allows the user to quit the current app and return to the Launcher.
As such the QuickMenu & MiniLauncher are essential features that should be included in every Lynx application.
Setup
The QuickMenu and MiniLauncher are designed to function together.
As such, both systems are bundled in a single "QuickMenu&MiniLauncher" prefab provided in the Lynx SDK Modules under handtracking.
The prefab can simply be at the scene hierarchy root or under a static gameobject.
For it to function correctly, it requires :
- A Unity XR Camera tagged "MainCamera" in the scene, allowing for correct interface positioning.
- That Lynx handtracking has been added to the scene through the SDK with the Unity event option on, meaning the Lynx UIInputEventSystem will be included, allowing for correct interface hand interactions.
To simplify that setup even further, the QuickMenu&MiniLauncher prefab is included by default when you add handtracking through the SDK.
How it works
Let's go through the main gameobjects of the QuickMenu&MiniLauncher prefab & how they are designed to work in running applications.
QuickMenu&MiniLauncher
One of the most important script for both QuickMenu and MiniLauncher is AndroidComMng. It is this script that interfaces with the Android layer of the OS to retrieve system information and call system actions.
The root of the QuickMenu&MiniLauncher prefab also contains other scripts implementing the actions that can be called from either QuickMenu or MiniLauncher.
QuickMenu
QuickMenu is designed to provide access to system-wide feature through a one-handed, ambidextrous gesture that is straightforward yet resistant to accidental triggering.
The hand tracking checks the following gesture aspects to activate the QuickMenu :
- Palm is facing towards the head camera beyond a minimal threshold.
- Palm is open, i.e. the pinky is extended.
- With the checks above to true, an index-thumb pinch is maintained for a given activation delay duration.
Once the QuickMenu is activated, while maintaining the index-thumb pinch, the desired action icon will be highlighted.
Upon pinch release the action of the highlighted icon will be called.
The QuickMenu script exposes many parameters related to activation, including restricting use to one hand. It is however recommended to leave those parameters as-is so that user experience across apps is homogenous.
Currently only the "Home" MiniLauncher action is functional, the rest will follow.
MiniLauncher
The MiniLauncher gameobject contains UI gameobjects individually responsible for pulling system data to display when the MiniLauncher is toggled on.
The MiniLauncherMng scripts takes care of the MiniLauncher activation & deactivation, as well as the different actions called from its buttons.
Currently the MiniLauncher only features a Resume button to toggle itself off, and a Quit button that quits the running XR application & returns the user to the Launcher home app.
The XRUIPositionner script takes care of the MiniLauncher positionning, and exposes several parameters to tweak that positioning, including movement types :
- locked : MiniLauncher won't move to remain close to the user.
- follow eye forward : MiniLauncher will continuously follow a target position placed at a fixed distance in front of the center of vision.
- threshold lerps : MiniLauncher will move along it's distance, height, and angle around the user if distinct distance, height or angle thresholds are exceeded.