Installing the package
March 31, 2021 · View on GitHub
Level: Beginner
Reading Time: 2 minutes
Checked with: Unity 2019.3.0f6
Introduction
The CameraRigs.UnityXRPluginFramework prefab provides a spatial camera rig and controller setup utilizing the XR Plugin Framework provided by the Unity software. This prefab can be included in a Unity software project via the Unity Package Manager.
Let's Start
Step 1: Creating a Unity project
You may skip this step if you already have a Unity project to import the package into.
- Create a new project in the Unity software version
2019.3.0f6(or above) using3D Templateor open an existing project.
Step 2: Configuring the Unity project
- Configure the project for XR:
- In the Unity software select
Main Menu -> Edit -> Project Settingsto open theProject Settingsinspector. - Select
XR Plug-in Management. ClickInstall XR Plug-in Managementif the package hasn’t been installed already. You can also install it from the Package Manager window. - After installation completes, select a Plug-in Provider to enable it for the corresponding build target. To do this:
- Select a build target (for example, Android).
- Select the checkbox to the left of each plug-in you want to use for that build target.
- After a plug-in loads, it displays in the left-hand navigation, under XR Plug-in Management. Click the plug-in to configure its settings for each build target.
- In the Unity software select
The
Configure the project for XRsteps are adapted from the official Unity Configuring your Unity Project for XR guide.
Step 3: Adding the package to the Unity project manifest
-
Navigate to the
Packagesdirectory of your project. -
Adjust the project manifest file
manifest.jsonin a text editor.- Ensure
https://registry.npmjs.org/is part ofscopedRegistries.- Ensure
io.extendrealityis part ofscopes.
- Ensure
- Add
io.extendreality.tilia.camerarigs.xrpluginframework.unitytodependencies, stating the latest version.
A minimal example ends up looking like this. Please note that the version
X.Y.Zstated here is to be replaced with the latest released version which is currently.
{ "scopedRegistries": [ { "name": "npmjs", "url": "https://registry.npmjs.org/", "scopes": [ "io.extendreality" ] } ], "dependencies": { "io.extendreality.tilia.camerarigs.xrpluginframework.unity": "X.Y.Z", ... } } - Ensure
-
Switch back to the Unity software and wait for it to finish importing the added package.
Done
The Tilia CameraRigs XRPluginFramework Unity package will now be available in your Unity project Packages directory ready for use in your project.
The package will now also show up in the Unity Package Manager UI. From then on the package can be updated by selecting the package in the Unity Package Manager and clicking on the Update button or using the version selection UI.