-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [3.0.6-preview.2] - 2019-12-20 * Fix package checking system to also look at installed packages and not just remotely registered packages. This allows us to see packages the user has locally installed on disk that may not be registered in the package registry. * Add check to make sure we pick up any class in the project that derives from XRLoader and not just those in packages. This allows a developer to create a loader in their assets folder and use that regardless of installed packages. ## [3.0.6-preview.1] - 2019-12-12 * Documentation copy review and edit. * Fix FB 1206103: Serialized loader list is not saved correctly when a new loader asset is created as part of the add operation.
- Loading branch information
Unity Technologies
committed
Dec 19, 2019
1 parent
08e124f
commit d01c933
Showing
7 changed files
with
201 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,59 @@ | ||
# End Users | ||
# End-user documentation | ||
|
||
### Installing an XR Plugin using XR Management | ||
To install an XR Plugin, do the following: | ||
1. Install the XR Management package from [Package Manager](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html) | ||
2. Once installed, the XR Management package will take you to the project settings window. | ||
3. Click on the **XR Plugin Management** tab | ||
- *Note*: The **XR Plugin Management** tab will not exist in Project Settings unless the XR Management package has been installed. | ||
4. In the **XR Plugin Management** tab window, click on the plus button to add a Loader for your plugin. | ||
5. If not already in the Available menu item, go to Download and select the plugin you are interested in. The XR Plugin will automatically download via the Package Manager. | ||
## Installing an XR plug-in using XR Plugin Management | ||
|
||
## Add default loader and settings instances if requested | ||
To install an XR plug-in, follow these steps: | ||
|
||
At package install time, the package may prompt you to create an instance of a loader and an instance of settings for the package. This step is entirely optional and is there simply to help the user get things going at installation time. | ||
1. Install the XR Plugin Management package from [Package Manager](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html). | ||
2. Once the XR Plugin Management package is installed, open the **Project Settings** window. Select the **XR Plugin Management** tab on the left. | ||
4. In the **XR Plugin Management** tab, click the **+** button to add a Loader for your plug-in. | ||
If the Loader you're looking for isn't in the list, you might need to install the provider for it. Select the **Install** button from the set of known providers, or use the **Package Manager** window (menu: **Window > Package Manager**) to install the provider you need. | ||
|
||
If you wish not to create this at installation time, the appropriate portion of the editor that require them (**XRManagerSettings** and **Unified Settings** will) prompt you to create them as well. | ||
|
||
**NOTE**: You can always manually control the XR system by accessing the **XRGeneralSettings.Instance.Manager.activeLoader** field once XR has been initialized. | ||
## Adding default Loader and Settings instances | ||
|
||
## Add plugin loaders as needed | ||
* Navigate to **Project Settings**. | ||
* Select the **XR Plugin Management** item in the settings selection on the left. | ||
* Modify loaders for each platform you are targeting. You can configure the set of loaders as well as their default ordering. | ||
When you install a package via XR Plugin Management, Unity might prompt you to create Loader and Settings instances for the package. This is an optional step to help you get things up and running. If you don't want to create these instances on package install, the Editor prompts you to create them when you access the components that require them (**XRManager Settings** and **Project Settings**). | ||
|
||
### Automatic manager loading of XR | ||
By default XR Management will automatically initialize and start your XR environment on application load. At runtime this happens immediately before first scene load. In Play mode this happens immediately after first scene load but before Start is called on your game objects. In either case XR should be setup before Start is called so you should be able to query the state of XR in the Start method of your game objects. | ||
**Note:** After an XR Provider Loader has been initialized, you can access the `XRGeneralSettings.Instance.Manager.activeLoader` field to manually control the XR Provider's subsystems. | ||
|
||
### If you wish to start XR on a per scene basis (i.e. start in 2D and transition into VR) | ||
* Make sure you disable the **Initialize on Startup** toggle for each platform you support. | ||
* At runtime use the **XRGeneralSettings.Instance.Manager** to add/create, remove and reorder the loaders you wish to use from the script. | ||
* To setup the XR environment to run manually call **InitializeLoader(Async)** on the **XRGeneralSettings.Instance.Manager**. | ||
* To start call **StartSubsystems** on **XRGeneralSettings.Instance.Manager**. This will put you into XR mode. | ||
* To stop call **StopSubsystems** on the **XRGeneralSettings.Instance.Manager** to stop XR. This will take you out of XR but should allow you to call **StartSubsystems** again to restart XR. | ||
* To shutdown XR entirely, call **DeinitializeLoader** on the **XRGeneralSettings.Instance.Manager**. This will clean up the XR environment and remove XR entirely. You must call **InitializeLoader(Async)** before you can run XR again. | ||
## Adding plug-in Loaders | ||
|
||
## Customize build and runtime settings | ||
To add plug-in Loaders, follow these steps: | ||
|
||
Any package that needs build or runtime settings should provide a settings datatype for use. This will be surfaced in the **Unified Settings** UI window underneath a top level **XR** node. By default a custom settings data instance will not be created. If you wish to modify build or runtime settings for the package you must go to the package authors entry in **Unified Settings** and select **Create**. This will create an instance of the settings that you can then modify inside of **Unified Settings**. | ||
1. Access the **Project Settings** window (menu: **Edit** > **Project Settings**). | ||
2. Select the **XR Plugin Management** tab on the left. | ||
3. Modify Loaders for each platform your application targets. You can configure the set of Loaders, and their default order. | ||
|
||
# Installing *XR Management* | ||
## Automatic XR loading | ||
|
||
Most likey the XR Provider package you want to use already includes XR Management so you shouldn't need to install it. If you do you can follow the directions provided in the top level documentation or follow the instructions in the [Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html). | ||
By default, XR Plugin Management intializes automatically and starts your XR environment when the application loads. At runtime, this happens immediately before the first Scene loads. In Play mode, this happens immediately after the first Scene loads, but before `Start` is called on your GameObjects. In both scenarios, XR should be set up before calling the MonoBehaviour [Start](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html) method, so you should be able to query the state of XR in the `Start` method of your GameObjects. | ||
|
||
# Installing *Legacy Input Helpers* | ||
If you want to start XR on a per-Scene basis (for example, to start in 2D and transition into VR), follow these steps: | ||
|
||
The Legacy Input Helpers package is required for correct operation of XR devices with unity. The **Input Helpers** setting page will check for, and allow easy installation of the legacy input helpers package if it is not found on the system. | ||
1. Access the **Project Settings** window (menu: **Edit** > **Project Settings**). | ||
2. Select the **XR Plugin Management** tab on the left. | ||
3. Disable the **Initialize on Startup** option for each platform you support. | ||
4. At runtime, call the following methods on `XRGeneralSettings.Instance.Manager` to add/create, remove, and reorder the Loaders from your scripts: | ||
|
||
This **Input Helpers** setting page can be found by | ||
* Navigate to Project Settings. | ||
* Select the **Input Helpers** sub item of the **XR Plugin Management** item in the settings selection. | ||
|Method|Description| | ||
|---|---| | ||
|`InitializeLoader(Async)`|Sets up the XR environment to run manually.| | ||
|`StartSubsystems`|Starts XR and puts your application into XR mode.| | ||
|`StopSubsystems`|Stops XR and takes your application out of XR mode. You can call `StartSubsystems` again to go back into XR mode.| | ||
|`DeinitializeLoader`|Shuts down XR and removes it entirely. You must call `InitializeLoader(Async)` before you can run XR again.| | ||
|
||
To handle pause state changes in the Editor, subscribe to the [`EditorApplication.pauseStateChanged`](https://docs.unity3d.com/ScriptReference/EditorApplication-pauseStateChanged.html) API, then stop and start the subsystems according to the new pause state that the `pauseStateChange` delegate method returns. | ||
|
||
## Customizing build and runtime settings | ||
|
||
Any package that needs build or runtime settings should provide a settings data type for use. This data type appears in the **Project Settings** window, underneath a top level **XR** node. | ||
|
||
By default, Unity doesn't create a custom settings data instance. If you want to modify build or runtime settings for the package, you must go to the package author’s entry in **Project Settings** and select **Create**. This creates an instance of the settings that you can then modify inside **Project Settings**. | ||
|
||
## Installing the XR Plugin Management package | ||
|
||
Most XR Plugin provider packages typically include XR Plugin Management, so you shouldn't need to install it. If you do need to install it, follow the instructions in the [Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html). | ||
|
||
## Installing the Legacy Input Helpers package | ||
|
||
Unity requires the Legacy Input Helpers package to operate XR devices correctly. To check if the Legacy Input Helpers package is installed, open the **Project Settings** window and navigate to **XR Plugin Management** > **Input Helpers**. If Unity can't locate the package, click the **Install Legacy Helpers Package** button to install it. |
Oops, something went wrong.