Skip to content

Commit bfe072f

Browse files
author
David Kline
authored
Merge pull request #6743 from CDiaz-MS/arfoundation_doc
Update to ARFoundation documentation
2 parents 6c31b9a + 1c7180d commit bfe072f

File tree

7 files changed

+100
-39
lines changed

7 files changed

+100
-39
lines changed

Documentation/CameraSystem/UnityArCameraSettings.md

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,12 @@
22

33
The Unity AR camera settings provider is an experimental MRTK component that enables mixed reality applications to run on Android and iOS devices.
44

5-
## Prerequisites
6-
7-
Before the Unity AR camera settings provider can be enabled in an application, the following steps need to be completed.
8-
9-
1. Download and import the **Microsoft.MixedReality.Toolkit.Providers.UnityAR** package, from GitHub or NuGet
10-
1. In the Unity Package Manager, ensure the following package(s) are installed:
11-
12-
| Unity 2018.4 | Unity 2019.x | Comments |
13-
| --- | --- | -- |
14-
| AR Foundation | AR Foundation | For Unity 2018.4, this package is included as a preview |
15-
| | XR Legacy Input Helpers | |
16-
| AR Core | | For Android device support |
17-
| AR Kit | | For iOS device support |
18-
19-
1. If using Unity 2019.x, the assembly definition file for the Unity AR provider needs to be modified to have the **UnityEngine.SpatialTracking** reference added.
20-
21-
![Unity AR assembly definition](../Images/CrossPlatform/UnityArAssemblyReferences.png)
22-
23-
## Enabling the Unity AR camera settings provider
24-
25-
The following steps presume use of the MixedRealityToolkit object. Steps required for other service registrars may be different.
26-
27-
1. Select the MixedRealityToolkit object in the scene hierarchy.
28-
29-
![MRTK Configured Scene Hierarchy](../Images/MRTK_ConfiguredHierarchy.png)
30-
31-
2. Navigate the Inspector panel to the camera system section and expand the **Camera Settings Providers** section.
32-
33-
![Expand settings providers](../Images/CameraSystem/ExpandProviders.png)
34-
35-
3. Click **Add Camera Settings Provider** and expand the newly added **New camera settings** entry.
36-
37-
![Expand new settings provider](../Images/CameraSystem/ExpandNewProvider.png)
38-
39-
4. Select the Unity AR Camera Settings provider
40-
41-
![Select Unity AR settings provider](../Images/CameraSystem/SelectUnityArSettings.png)
42-
43-
## Configuring the Unity AR camera settings provider
5+
## Unity AR camera settings provider options
446

457
![Unity AR camera settings configuration](../Images/CameraSystem/UnityArSettingsConfiguration.png)
468

9+
For a guide on how to add the provider to your scene: [How to configure MRTK for iOS and Android](../CrossPlatform/UsingARFoundation.md)
10+
4711
### Tracking settings
4812

4913
The Unity AR camera settings provider allows configuration options for how tracking is performed. These settings are specific to the Unity AR camera settings provider implementation.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# How to configure MRTK for iOS and Android [Experimental]
2+
3+
## Install Required Packages
4+
5+
1. Download and import the **Microsoft.MixedReality.Toolkit.Providers.UnityAR** package, from [GitHub](https://github.com/microsoft/MixedRealityToolkit-Unity/releases/tag/v2.2.0) or [NuGet](../MRTKNuGetPackage.md)
6+
7+
> [!NOTE]
8+
> After you import the the UnityAR package, you will see the following error:
9+
> *Assembly has reference to non-existent assembly 'Unity.XR.ARFoundation' (Assets/MixedRealityToolkit.Staging/UnityAR/Microsoft.MixedReality.Toolkit.Providers.UnityAR.asmdef)*
10+
". To resolve, install the correct version of ARFoundation listed below.
11+
12+
13+
2. In the Unity Package Manager (UPM), install the following packages:
14+
15+
### Unity 2018.4.x
16+
17+
| **Android** | **iOS** | Comments |
18+
| --- | --- | --- |
19+
| AR Foundation <br/> Version: 1.5.0 - preview 6 | AR Foundation <br/> Version: 1.5.0 - preview 6 | For Unity 2018.4, this package is included as a preview. To view package: Window > Package Manager > Advanced > Show Preview Packages|
20+
| ARCore XR Plugin <br/> Version: 2.1.2 | | |
21+
| | ARKit XR Plugin <br/> Version: 2.1.2 | |
22+
23+
24+
### Unity 2019.x
25+
26+
| **Android** | **iOS** |
27+
| --- | --- |
28+
| AR Foundation <br/> Version: 2.1.4 | AR Foundation <br/> Version: 2.1.4 |
29+
| ARCore XR Plugin <br/> Version: 2.1.2 | |
30+
| | ARKit XR Plugin <br/> Version: 2.1.2 |
31+
32+
33+
34+
1. If using Unity 2019.x, the assembly definition file for the Unity AR provider needs to be modified to have the **UnityEngine.SpatialTracking** reference added.
35+
36+
![Unity AR assembly definition](../Images/CrossPlatform/UnityArAssemblyReferences.png)
37+
38+
## Enabling the Unity AR camera settings provider
39+
40+
The following steps presume use of the MixedRealityToolkit object. Steps required for other service registrars may be different.
41+
42+
1. Select the MixedRealityToolkit object in the scene hierarchy.
43+
44+
![MRTK Configured Scene Hierarchy](../Images/MRTK_ConfiguredHierarchy.png)
45+
46+
2. Select **Copy and Customize** to Clone the MRTK Profile to enable custom configuration.
47+
48+
![Clone MRTK Profile](../Images/CameraSystem/CloneProfileARFoundation.png)
49+
50+
3. Select **Clone** next to the Camera Profile.
51+
52+
![Clone MRTK Camera Profile](../Images/CameraSystem/CloneCameraProfileARFoundation.png)
53+
54+
4. Navigate the Inspector panel to the camera system section and expand the **Camera Settings Providers** section.
55+
56+
![Expand settings providers](../Images/CameraSystem/ExpandProviders.png)
57+
58+
5. Click **Add Camera Settings Provider** and expand the newly added **New camera settings** entry.
59+
60+
![Expand new settings provider](../Images/CameraSystem/ExpandNewProvider.png)
61+
62+
6. Select the Unity AR Camera Settings provider
63+
64+
![Select Unity AR settings provider](../Images/CameraSystem/SelectUnityArSettings.png)
65+
66+
For more information about configuring the Unity AR camera settings provider: [Unity AR camera settings provider](../CameraSystem/UnityArCameraSettings.md).
67+
68+
## Building a Scene for Android and iOS devices
69+
70+
1. Make sure you have added the UnityAR Camera Settings Provider to your scene.
71+
72+
2. Switch platform to either Android or iOS in the Unity Build Settings
73+
74+
When you switch the platform you should see the MRTK Project Configurator Window with settings for your chosen platform. Click Apply to enable platform specific settings.
75+
76+
iOS Project Configurator Settings
77+
78+
![iOS Project Configurator](../Images/CameraSystem/MRTKProjectConfigurator.png)
79+
80+
3. There are no additional steps after switching the platform for Android.
81+
82+
4. If the platform is iOS, Edit > Project Settings > Player > Other Settings, under the Optimization header, **uncheck** Strip Engine Code
83+
84+
![iOS Settings](../Images/CameraSystem/UncheckStripEngineCodeiOS.png)
85+
86+
> [!NOTE]
87+
> Unchecking Strip Engine Code is the short term solution to an error in Xcode [#6646](https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6646). We are working on a long term solution for MRTK 2.3.0.
88+
89+
5. Build and run the scene
90+
91+
## See Also
92+
93+
- [Unity AR Camera Settings](../CameraSystem/UnityArCameraSettings.md)
46.6 KB
Loading
79.2 KB
Loading
48.8 KB
Loading
21.9 KB
Loading

Documentation/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
href: CameraSystem/UnityArCameraSettings.md
5252
- name: Creating a camera settings provider
5353
href: CameraSystem/CreateSettingsProvider.md
54+
- name: Cross Platform Support
55+
items:
56+
- name: Configure MRTK for iOS and Android
57+
href: CrossPlatform/UsingARFoundation.md
5458
- name: Detecting Platform Capabilities
5559
href: DetectingPlatformCapabilities.md
5660
- name: Diagnostics System

0 commit comments

Comments
 (0)