# XR Interaction Toolkit Examples
Example projects that use [XR Interaction Toolkit](https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@latest) to demonstrate its functionality with sample assets and behaviors.
The intention of this repository is to provide a means for getting started with the features in the XR Interaction Toolkit package.
## Technical details
### Preview package
The XR Interaction Toolkit is available as a preview package, so it is still in the process of becoming stable enough to release. The features and documentation in this package might change before it is ready for release.
Additionally, the behaviors included in this example may change in a way that does not maintain backwards compatibility.
### Requirements
These projects are compatible with the following versions of the Unity Editor:
- 2019.4 and later
### Other packages
These example projects rely on additional Unity packages that are 2019.4 verified:
- [AR Foundation 2.1](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@2.1/manual/index.html)
- [Input System 1.0](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/index.html)
- [XR Plugin Management 3.2](https://docs.unity3d.com/Packages/com.unity.xr.management@3.2/manual/index.html)
### Sharing feedback
The [XR Interaction Toolkit and Input forum](https://forum.unity.com/forums/xr-interaction-toolkit-and-input.519/) is the best place to open discussions and ask questions. Please use the [public roadmap](https://portal.productboard.com/brs5gbymuktquzeomnargn2u) to submit feature requests. If you encounter a bug, please use the Unity Bug Reporter in the Unity Editor, accessible via **Help > Report a Bug**. Include “XR Interaction Toolkit” in the title to help our team triage things appropriately!
### Contributions and pull requests
We are not accepting pull requests at this time.
## Getting started
1. Clone or download this repository to a workspace on your drive
1. Click the **⤓ Code** button on this page to get the URL to clone with Git or click **Download ZIP** to get a copy of this repository that you can extract
1. Open a project in Unity
1. Download, install, and run [Unity Hub](https://unity3d.com/get-unity/download)
1. In the **Installs** tab, select **Locate** or **Add** to find or install Unity 2019.4 LTS or later
1. In the **Projects** tab, click **Add**
1. Browse to the AR or VR folder within your downloaded copy of this repository and click **Select Folder**
1. Click the project which should now be added to the list to open the project
1. For the VR project, open the Scene at `Assets\Scenes\WorldInteractionDemo` by double clicking it in the Project window. For the AR project, open the Scene at `Assets\Scenes\ARInteraction`.
1. Configure the VR project for XR devices
1. From Unity’s main menu, go to **Edit > Project Settings > XR Plug-in Management**, and select the platform(s) you plan to deploy to
1. To run the VR sample on a headset, go to **File > Build Settings** and build the app. If you have a PC VR headset, you can also preview the app by connecting your device and clicking **Play (►)**
If using VR, make sure the Game view has focus (required for XR input currently) by clicking it with your mouse. A **Lock Input to Game View** option is available in the [Input Debugger](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Debugging.html#input-debugger) window (**Window > Analysis > Input Debugger**). Enabling this option forces input to continue processing even when the Game view does not have focus.
## Project overview
This repository contains two different example Unity projects, one with a focus on a Virtual Reality ([VR](#vr)) experience, and another with a focus on an Augmented Reality ([AR](#ar)) experience for mobile.
### VR
This example project contains several Scenes located in `Assets\Scenes` and `Assets\VR Examples\Scenes`.
|**Scene**|**Description**|
|---|---|
|`Scenes\WorldInteractionDemo`|<p>This Scene contains several demo stations that demonstrate various features of the XR Interaction Toolkit. This scene also uses an XR Rig to showcase various ways of navigating the virtual environment via locomotion, including snap-turning, continuous turning, continuous movement, and teleportation.</p><p>This Scene also makes use of several custom behaviors included with this Unity project, including a Controller Manager which manages a logical controller state to selectively enable or disable certain input actions and behaviors.</p><p>Your left hand can grab objects remotely using a Ray Interactor, and your right hand can grab objects directly using a Direct Interactor. Pushing up on the thumbstick will switch to a different Ray Interactor used for teleportation, and releasing the thumbstick will teleport when aiming at a valid location. Pushing left, right, or down on the thumbstick will turn left, right, or around, respectively.</p><p>Use the trigger to interact with the UI in the world while pointing at it with the left controller. The station in the Scene labeled Locomotion Configuration can be used to change locomotion control schemes and configuration preferences. For example, using the controller to enable Continuous Move will make it so the rig will move based on the left controller thumbstick instead of being used to turn and teleport.</p>|
|`Scenes\DeprecatedWorldInteractionDemo`|<p>A similar environment to WorldInteractionDemo, but with an alternate XR Rig setup that uses the Device-based variants of behaviors that do not use the Input System.</p><p>It is recommended that you use the Action-based variant of behaviors used in WorldInteractionDemo instead of the Device-based variant to take advantage of the benefits that the Input System package provides. Some features, such as the XR Device Simulator, are only supported when using Actions. This Scene is included mainly as a reference for users who began using the package before version 0.10.0.</p>|
|`VR Examples\Scenes\Initial Tracking`|<p>This is a basic scene that shows how to set up device tracking. Look around in your VR headset and identify the tracked hand controllers.</p>|
|`VR Examples\Scenes\Grab Interaction`|<p>This scene shows how to set up a grab interactable that can be grabbed by either hand controller.</p><p>Your left hand can grab the cube remotely using a Ray Interactor, and your right hand can grab it directly using a Direct Interactor.</p>|
|`VR Examples\Scenes\Socket Interaction`|<p>This scene shows how to set up a socket to hold an interactable.</p><p>Grab the cube then try throwing it to the socket. You will see the cube snap to the socket.</p>|
|`VR Examples\Scenes\Teleportation`|<p>This scene shows examples of configuring Teleportation Areas, Anchors, and options on visuals and orientation.</p><p>Use the Trigger (Select) button on your controller to teleport when pointing to a platform.</p>|
|`VR Examples\Scenes\UI Interaction`|<p>This scene shows how to set up a world canvas UI.</p><p>Use the trigger button to interact with the UI elements.</p>|
#### Controller Manager
This project contains two variants of a Controller Manager behavior to manage multiple Interactors depending on different conditions of the player.
The `ActionBasedControllerManager` script makes use of Input System Actions to both read input to detect logical controller state changes, and to enable or disable shared Actions. This is used in the `WorldInteractionDemo` Scene to swap between two mutually exclusive Interactor behaviors for each controller. For example, for the right-hand Controller Manager, when detecting input to activate a teleportation mode, the behavior as configured in the Scene will swap between the Direct Interactor used for grabbing objects, and the Ray Interactor used for aiming a teleportation arc.
The `ControllerManager` script is similar to the `ActionBasedControllerManager` script, but
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
XR-Interaction-Toolkit-Examples-master.zip (722个子文件)
LiberationSans SDF.asset 2.15MB
Roboto-Bold SDF.asset 2.02MB
Roboto-Medium SDF.asset 565KB
LightingData.asset 45KB
LightingData.asset 45KB
ProjectSettings.asset 20KB
ProjectSettings.asset 20KB
LightingData.asset 18KB
LightingData.asset 18KB
LightingData.asset 18KB
LightingData.asset 18KB
LightingData.asset 18KB
EmojiOne.asset 13KB
InputManager.asset 10KB
LiberationSans SDF - Fallback.asset 9KB
Default Style Sheet.asset 9KB
QualitySettings.asset 6KB
QualitySettings.asset 6KB
InputManager.asset 6KB
XRGeneralSettings.asset 5KB
XRGeneralSettings.asset 4KB
GraphicsSettings.asset 3KB
GraphicsSettings.asset 2KB
Physics2DSettings.asset 2KB
TMP Settings.asset 2KB
XR_UniversalRenderPipelineAsset.asset 2KB
PresetManager.asset 1KB
Physics2DSettings.asset 1KB
XR_UniversalRenderPipelineAsset_Renderer.asset 1KB
Windows MR Package Settings.asset 1KB
NavMeshAreas.asset 1KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
EditorSettings.asset 1KB
EditorSettings.asset 1KB
DynamicsManager.asset 1KB
PackageManagerSettings.asset 863B
PackageManagerSettings.asset 863B
UnityConnectSettings.asset 853B
UnityConnectSettings.asset 853B
PresetManager.asset 797B
InputSystem.inputsettings.asset 738B
EditorBuildSettings.asset 697B
Oculus Settings.asset 614B
EditorBuildSettings.asset 485B
AR Core Loader Settings.asset 442B
AR Kit Loader Settings.asset 441B
URPProjectSettings.asset 410B
Windows MR Loader.asset 406B
AR Core Loader.asset 403B
Oculus Loader.asset 402B
TagManager.asset 402B
AR Kit Loader.asset 402B
TagManager.asset 386B
AudioManager.asset 360B
AudioManager.asset 360B
VFXManager.asset 273B
VFXManager.asset 273B
TimeManager.asset 202B
TimeManager.asset 197B
XRSettings.asset 158B
XRSettings.asset 157B
NetworkManager.asset 151B
ClusterInputManager.asset 114B
ClusterInputManager.asset 114B
XRPackageSettings.asset 73B
XRPackageSettings.asset 73B
TMPro_Surface.cginc 4KB
TMPro_Properties.cginc 3KB
TMPro.cginc 2KB
Llama.controller 4KB
LocomotionConfigurationMenu.cs 26KB
LocomotionSchemeManager.cs 22KB
ActionBasedControllerManager.cs 20KB
ControllerManager.cs 12KB
BubbleGun.cs 2KB
ComplexCube.cs 2KB
SwitchPlacementPrefab.cs 1KB
UpdateControlText.cs 1KB
SetTargetFramerate.cs 766B
DisableDebugPlaneOnDevice.cs 422B
Lightmap-0_comp_light.exr 1.31MB
Lightmap-0_comp_light.exr 1.24MB
ReflectionProbe-1.exr 281KB
ReflectionProbe-1.exr 281KB
ReflectionProbe-2.exr 203KB
ReflectionProbe-2.exr 203KB
ReflectionProbe-4.exr 192KB
ReflectionProbe-4.exr 192KB
ReflectionProbe-5.exr 191KB
ReflectionProbe-5.exr 191KB
ReflectionProbe-0.exr 170KB
ReflectionProbe-3.exr 170KB
ReflectionProbe-3.exr 170KB
ReflectionProbe-0.exr 169KB
ReflectionProbe-0.exr 135KB
ReflectionProbe-0.exr 135KB
ReflectionProbe-0.exr 135KB
ReflectionProbe-0.exr 135KB
ReflectionProbe-0.exr 135KB
共 722 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
游鱼没有游鱼
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0