Install and Setup SDK Examples
This section describes how to download and configure the Magic Leap Unity Example project.
- Installed the ML Hub
- Unity Editor in the range of 2022.2.x
Downloading the Examples
This section will walk you through downloading the Magic Leap Examples Unity project using the Package Manager inside ML Hub.
Open The Package Manager
To access the Package manager in ML Hub
- Open ML Hub.
- Select Package Manager from the home screen.
Next you can either download the examples project using the Package Bundles, or as an individual package.
Download using Package Bundles
To download the Unity Magic Leap Examples Project from the bundle section
- Select the Unity - 3D Creation Bundle
- Next, select the Unity Examples item from the Change Summary section.
- Click Apply Changes.
Download Individual Package
To download the Unity Magic Leap Examples Project as an individual package
- Navigate to the All tab
- Next, select the Unity Examples item from the Unity Packages section.
- Lastly, click Apply Changes from the summary section.
Open the Example Project
Once the project has been downloaded, open the project using the Unity Hub.
- Open the Unity Hub application
- Click Open in the upper right corner of the home page and navigate to the MagicLeap_Examples project inside your
- Make sure the project is opened using the Magic Leap 2 compatible editor version that you installed in Getting Started.
- Select the MagicLeap_Examples folder and click Open.
When opening the project, unity may prompt you to open the project in safe mode. Select ignore.
Building to Device
- Once the project is open, make sure that Magic Leap is enabled in the Android inside the project XR Plug-in Management settings (File > Build Settings > Player Settings > XR Plug-in Management).
- Open the build menu under File > Build Settings and select any or all of the scenes you wish to demo. The scenes will allow you to switch between examples from within the app, so feel free to include all of the examples.
- Make sure your build target is set to Android.
- Turn on and connect your Magic Leap 2 via USB, then select the device under Run Device.
- Build and Run!
For information on which of these examples work in App Simulator refer to the App Simulator Key API Features guide.