Starting with the Oculus Integration v19 release, if an app does not support focus awareness, Oculus will flag it with a warning at the time of submission to Oculus Store. We highly recommend that you enable the focus awareness feature early in your development process to test how your app handles the loss of input and let the system UI appear as an overlay.
Focus awareness allows many forms of Oculus system user interfaces (UI), such as universal menu or system keyboard, to appear as an overlay on top of an app without pausing the immersive experience. This allows users to access the system UI without context switching away from the app, keeping users engaged in the experience. Focus awareness uses the concept of input focus, a system for tracking whether the user is focused on the app or elsewhere, to correctly handle times when the app is running but the user is interacting with system UI. Based on input focus, apps can take appropriate action when an overlay appears. For example, when the universal menu appears on top of an app, the app continues to run but may pause the gameplay as the input focus is lost.
When you enable focus awareness, there is a change in how system UI is rendered. For example, when the user presses the Oculus button on the controller, depending on whether your app supports focus awareness, the universal menu is displayed in either of the following ways:
When the universal menu is active, the runtime renders the tracked controllers in the scene to interact with the system UI.
To integrate system overlays, your app must support focus awareness and use the latest OVRPlugin.
With focus awareness enabled, you can add event handlers for every event that is raised when an app gains or loses focus.
When system UI overlays the app, the app loses the input focus and the
OVRManager.InputFocusLost event is triggered. For example, when the user presses the Oculus button on the controller while the app is running, the app loses input focus. When the system UI is dismissed, the app gains the input focus and the
OVRManager.InputFocusAcquired event is triggered.
Depending upon the input focus event, you can perform several actions:
OVRManager.InputFocusAcquiredevent is triggered, you can resume gameplay or show the user’s input affordance.
To preview an overlay, enable the universal menu:
Note: Make sure that you’ve enabled the Focus Aware feature in Unity Editor.
Pressing the Oculus button while your app is running lets the universal menu display as an overlay.
We recommend testing your apps with this feature enabled so that you are prepared when the Focus Aware feature turns into a default system behavior.