XRShared
XRSharedアドオンは、Fusionと互換性があるXRアプリケーションを作成するための基本的なコンポーネントを提供します。
アーキテクチャと詳細な解説
このアドオンで提供されているコンポーネントでビルドされたロジックについては、VR Shared sampleをご覧ください。そこで最良で詳細な解説が行われています。
特徴
リグのロジック:ハードウェアとネットワーク
概要はVRSharedサンプルのRigsをご覧ください。
以下のスクリプトは、様々なリグ部分(ヘッドセット・左手・右手・ルート)の位置を収集するために使用されます。
HardwareRig
HardwareHeadset
HardwareHand
そして、それらに対応するネットワークのスクリプトが、ハードウェアのスクリプトから提供されるローカルユーザーの位置/回転のデータを収集し、すべてのプレイヤーと同期します。
NetworkRig
NetworkHeadset
NetworkHand
基本的な手の状態(人差し指・親指・掴んだ位置)も、手のスクリプトで同期されます。

グラブ
基本的なグラブ(掴む)機能がアドオンで示されています。ここでは、2つのアプローチが使用可能です。
Basic grabbing functionality is demonstrated in the addon. Two approaches are available.

ネットワークハンドベースのグラブ
ネットワークベースのグラブの概要は、VR SharedサンプルのGrabbingをご覧ください。
このアプローチは、ネットワーク上の手のCollider
が、掴む対象に重なっているかを判定します。
掴む対象のオブジェクトにはNetworkHandColliderGrabbable
コンポーネントが、NetworkHand
にはNetworkHandColliderGrabber
コンポーネントが付いている必要があります。
ハードウェアハンドベースのグラブ
ハードウェアリグによってグラブを行うアプローチは、専用ページのLocal rig grabbingをご覧ください。
このアプローチは、ハードウェアの手のCollider
が重なっているかを判定し、非ネットワークオブジェクトでも使用できます。
非ネットワークのグラブでは、掴む対象のオブジェクトにはGrabbale
が、ハードウェアの手にはGrabber
コンポーネントが必要です。
ネットワーク上のグラブでは、上記のコンポーネントに加えて、掴む対象のオブジェクトにはNetworkGrabbable
コンポーネントが、NetworkHand
にはNetworkGrabber
コンポーネントが付いている必要があります。
ロコモーション
詳細はTeleport & locomotionをご覧ください。
アドオンでは、基本的なロコモーションとシンプルなテレポーテーションを示しています。
RayBeamer
クラスは、ラインレンダラーベースのビームを表示します。リリースすると、HardwareRig
がリグの移動をトリガーし、その場所にRigLocomotion
が移動します。
RigLocomotion
スクリプトは、回転のスナップも制御します。

デモ
デモシーンはAssets\Photon\FusionAddons\XRShared\Demo\Scenes\
フォルダーにあります。
ダウンロード
このアドオンの最新バージョンは、Industries アドオンのプロジェクトに含まれています。
また、無料のXR アドオンのプロジェクトにも含まれています。
対応するトポロジー
- 共有モード
更新履歴
- Version 2.0.6:
- Add basic feedback component to XRShared
- Add SharedDesign folder with common materials and UI elements
- Add cooldown to PrefabSpawner
- Add IContactHandler interface
- Prevent Toucher to trigger callbacks on remote user when used on a NetworkObject (by default, only the state authority of the toucher parent can trigger a toucher)
- Ungrab when loosing the state authority on a NetworkGrabbable
- Version 2.0.5:
- Fix XRControllerInputDevice position when using Oculus XR plug-in
- Allow to prevent temporarily snap rotation in RigLocomotion
- Add basic UserSpawner script
- Add HideRenderers script
- Version 2.0.4:
- Prevent disabled Grabber components from grabbing
- Add reference transforms to the hardware hand: it will be moved at the first active (in hierarchy) transform listed
- Add WeaverHelper (to check/edit assembliestoWeave in config) and improvement to PackagePresenceCheck
- Version 2.0.3:
- Add IColorProvider and IFeedbackHandler interfaces
- Add GrabbableColorSelection
- Version 2.0.2:
- Ensure compatibility with Unity 2021.x (box colliders, edited in 2022.x, in prefab had an improper size when opened in 2021.x)
- Add layer utils to simplify automatic configuration of layers between projects
- Version 2.0.1: Add VolumeCamera handling in HideForLocalUser if Polyspatial is installed
- Version 2.0.0: First release