KEYSDK should seamlessly upgrade to all current versions of unity. Please re-import the PracticaManaged DLL if you run into issues upgrading.
- Register at https://developer.practicalvr.com
- Create an application in the portal and copy your API Key.
- Important - before importing, in player settings, set the "Scripting Runtime Version" to 4.6 and the "Scripting Backend" to .NET.
- Import KEYSDK and StreamingAssets folders.
- Place the "PracticalManager" and optional "PracticalCamera" prefabs into scene.
- Insert API Key into Practical Manager.
- Hit play and start developing!
- Add in the spatial placement tool and start defining where you want things placed. See the Spatial Placement Tool section below for more details.
Bonus -- give us some feedback!
- Pictures Library (App will hang without it)
- Spatial Perception
- Internet Client
- Microphone (For Example Scene only)
Through October, developers that sign-up and create their first application will gain permanent access to the Cyber, Nature, Frost, and Fire themes. To check them out, simply deploy an application utilizing the KEYSDK with an active API Key and click the buttons in the portal to change your theme.
On the Practical Manager GameObject, you should now see a script named "Mapping". This script now contains a simple event handler that allows you to trigger a function of your choosing after we have completed mapping. Scene changes are recommended, but you can use this event any way that you choose.
You can customize spawn groups with the Practical Location Builder script located on the Practical Manager prefab. Calls to the spawning API can only be made from async methods.
First, you must add the Spatial Placement Tool
script to a gameobject within your scene. Note: turning the object into a prefab will break this script. Please only save the chosen object via the Unity scene. This editor tool is where you can easily add new groups and select the types of places you'd like them to spawn.
Now, include the spawning system into your script:
using PracticalManaged.Practical.SpatialSpawning;
then create an async method:
private async void BlueSpawn()
call the "GetSpawnPoint" API and pass in the name of the group you created with the location builder inspector tool to return a position:
SpawnLocation returnedLocation = await PracticalLocator.Instance.GetSpawnPoint("Yellow Group");
You can then access the returned location and rotation:
Vector3 position = returnedLocation.Position;
Quarternion rotation = returnedLocation.Rotation;
All together, it should look like this:
private async void RedSpawn()
{
Debug.Log("Running Query");
SpawnLocation returnedLocation = await PracticalLocator.Instance.GetSpawnPoint("Red Group");
if (returnedLocation != null)
{
Debug.Log("Position: " + returnedLocation.Position);
Instantiate(RedDisk, returnedLocation.Position, returnedLocation.Rotation);
Debug.Log("Red disk placed");
}
}
There is an example folder that shows usage and has a scene to show functionality on device.
- There is a slight hang at the start of the application as it downloads a new theme. UX improvement to come.
- The application will not start at all unless a valid API Key is provided. Check phantom spacing at the front and back of your key.
- Microphone is not enabled after receiving the permission pop-up on Windows RS4 and up.