Desktop Focus
Desktop Focus Mode
Given the very significant difference in interaction capabilities between a VR headset and a mouse-driven 3D computer application, it can be complicated to develop a tool or a user interface that works well in both cases.
To facilitate prototyping, the "Desktop Focus" module enables the user interface to be switched to a mode optimized for mouse control.
Desktop Focus Manager
The DesktopFocusManager
is in charge to manage focus requests from objects in the scene.
It provides a public GiveFocus
method that is called by DesktopFocus
objects when they need the focus.
If an object already had the focus, it loses it and the focus is allocated to the new requester.
When the focus is assigned, desktop rig camera is disabled, the focusCamera
camera child object is activated and moved to the position specified by the requester thanks to the IFocus
interface.
Also, if the DesktopFocus
object defines a specific UI (i.e. canvas), it is enabled.
Finally, desktop rig control elements are deactivated (desktopController
, mouseCamera
& mouseTeleport
) in order to use the DesktopFocus
object UI properly.
Desktop Focus
During Awake()
, the DesktopFocus
objects search for the DesktopFocusManager
.
When the focus mode is activated :
- The
CameraAnchor
is used to define the camera position, - a list of canvas to be displayed can be specified,
- a list of renderers to be hidden can be specified,
In this way, the UI interface can be optimized for each tool.
It is also possible to define a previous/next DesktopFocus
object: indeed, in some use cases, it can be usefull to chain focus objects so that the user can navigate between DesktopFocus
objects without returning to the normal mode.
Demo
A demo scene can be found in Assets\Photon\FusionAddons\DesktopFocus\Demo\Scenes\
folder.
The scene contains 3 panels.
Each panel contains a DesktopFocus
component, while a DesktopFocusManager
and a FocusCamera
are located under the ConnectionManager
.
The focus mode can be activated using the button under each panel.
When the focus mode is activated, the player can see the other panels by using the left or right arrow keys on the keyboard.
Focus mode can be deactivated using the "Esc" key.
Download
This addon latest version is included into the addon project
Supported topologies
- shared mode
Changelog
- Version 1.0.2: Namespace modification
- Version 1.0.1: Add demo scene + Fix typo + add a context menu for ToggleFocus + add namespace
- Version 1.0.0: First release