Setup the development environment
This section will illustrate how to install HoloKit Unity SDK and setup the Unity project before you can do any coding.
Unzip the HoloKit Unity SDK zip file and get the Unity package folder
com.holoi.holokit. Then drag the folder into the
Packagesfolder of your Unity project.
Put the HoloKit Unity SDK package folder into the Unity project Packages foler
All dependency packages will be installed automatically after HoloKit SDK is installed, which are ARFoundation, ARKit, XR Plugin Management and URP (we highly recommend you use URP for all HoloKit projects).
Open Unity project build settings and switch the platform to iOS.
Switch project platform to iOS
Edit->Project Settings->XR Plug-in Management->iOS, make sure
Apple ARKitis selected. Please also make sure
Initialize XR on Startupis selected.
Tick the Apple ARKit option
Since ARKit needs to access the device camera, we have to add a friendly text to inform the user. Fill the camera usage description field with some reasonable words to ask the user to allow the access.
(This step is optional, you can build a HoloKit project with the Unity default render pipeline. But we highly recommend you to use URP since VFXs have a very good effect on HoloKit and they are only supported under URP.)
Create a new URP Asset as shown below.
Create a URP asset
After creating the URP asset, select its corresponding renderer asset and add
AR Background Render Feature.
Select the corresponding renderer asset
Add AR Background Renderer Feature
Edit->Project Settings->Graphics, and drag the newly created URP asset onto the
Scriptable Render Pipeline Settings field.
Now you've properly setup the Unity project, we can finally do some real stuff.