Extended Rig Selection
Extended Rig Selection
This module allows to specify and select the local rig that is enabled at runtime.
When the rig selection is done, the connexion handler is enabled : if it contains a ConnectionManager, and the selected rig as a custom rig, the ConnectionManager.userPrefab will be replaced by the specific NetworkRig.
The connexion handler is the game object starting the connection (the runner with its ConnectionManager, or with a FusionBootstrap and a UserSpawner): set it in the connexionHandler field of ExtendedRigSelection (or per rig description, to override it).
It is disabled until a rig is selected, so that the connection does not start with the wrong rig: if the field is empty, only an error is logged, and the connection may start before the selection.
Rig Description
According to your use case and supported hardwars, you may need to use several kind of rigs in you application.
This module allows you to add these rigs to a list of RigKindDescription.
A rig has several parameters described into the RigKindDescription structure :
- a name,
- a list of game object that will be enabled if the rig is selected,
- a bool to set if a specific prefab must be used (only relevant if a connexion manager is present on the connexion handler)
- an optionnal specific network rig prefab,
- the platform on which it can be selected automatically (automaticSelectOnTargetPlatform, targetPlatform), optionally restricted to some device models (deviceModelConstraint: the device model must contain this value, | separating several accepted values),
- a disabled flag: a disabled rig is ignored by all selection modes and hidden from the selection UI (its specific game objects are disabled).
How rig is selected
There are several options regarding the rig selection (selectionMode):
AutomaticSelection(default): the first enabled rig compatible with the platform (automaticSelectOnTargetPlatform) is selected (the list order solves conflicts). If no rig is compatible, the UI buttons are displayed,SelectedByUI: the user selects the rig at startup using UI buttons, in the editor and in builds (the choice is saved as the user preference, which onlySelectedByUserPrefreads),SelectedByUserPref: the rig is automatically selected using the user's preference, saved when a rig is chosen in the UI,SelectedByForcedValue: the rig is forced to theRigKindDescriptionnamed inforcedKindName.
In SelectedByUI and SelectedByUserPref modes too, the first enabled rig compatible with the platform (automaticSelectOnTargetPlatform) is selected automatically: before displaying the UI buttons in SelectedByUI mode, and when no user preference is available in SelectedByUserPref mode.

Editor buttons let quickly define the selection mode and associated parameters. For example, it will write the user's preference file if a Use Rig with preference Selection button is pressed or set the Forced Kind Name field if the selection mode is set to Forced Value
Please note that if the forceVROnAndroid bool is set to true (default), the VR rig will be always used on Android, except in AutomaticSelection mode. It is kept for existing projects: use the platform settings of the rig descriptions instead.
The verboseLogs option logs the details of the rig selection (platform and device model checks).
Existing scenes and prefabs keep their serialized selection mode.
Dependencies
- ConnectionManager addon
- XRShared addon
Demo
A demo scene can be found in the Samples/ExtendedRigSelection/Scenes folder of the addon.
Three differentes Rig can be selected using the ExtendedRigSelection editor's button :
- VR Rig associated with a cube,
- Desktop Rig associated with a sphere,
- no Rig with no associated object.
Download
This addon latest version is included into the XR Addons project
Supported topologies
- shared mode
- host mode
Changelog
- Version 2.2.0:
- Add AutomaticSelection mode (new default): first enabled rig compatible with the platform (list order solves conflicts), UI if none. Ignores user preference, forcedKindName and forceVROnAndroid
- Add a disabled flag on rig descriptions: a disabled rig is ignored by all selection modes and hidden from UIs
- The user preference is now only saved when the rig is chosen in the UI: an automatic selection no longer overrides later platform logic changes in SelectedByUserPref mode
- forcedKindName is only used in SelectedByForcedValue mode
- Add verboseLogs option to log the rig selection details
- Note: existing scenes and prefabs keep their serialized selection mode
- Version 2.1.3:
- Fix deviceModelConstraint matching any device when it contains an empty value (ie. a trailing '|')
- Version 2.1.2:
- Improve platform specific detection
- Fix issue when deleted current preference
- Version 2.1.1: Fix demo scene
- Version 2.1.0: Update to support new XRShared architecture
- Version 2.0.6:
- Prefab root transform fix to comply to asset store requirements
- Version 2.0.5:
- Update ExtendedRigSelection to set the user prefab when connection is managed by a IUserSpawner
- Version 2.0.4:
- Allow to specify a different connection manager for each rig
- Allow to spawn object for a specific rig
- Version 2.0.3:
- Add the option to auto install a rig on some platforms (unless force selection is choosen)
- Add PlatformSpecificMaterial
- Version 2.0.2: Fix to register objects with INetworkRunnerCallbacks interface on the runner (if the runner is disabled)
- Version 2.0.1: Add hardwareRig detection
- Version 2.0.0: Fusion 2.0 support
- Version 1.0.2: Namespace modification
- Version 1.0.1: Add demo scene + add namespace
- Version 1.0.0: First release
Last updated on
Back to top