Meta Unity Starter Samples

repository·main·Indexed 42 days ago

https://github.com/oculus-samples/unity-startersamples

A collection of Unity scenes and code designed to help developers implement Meta XR APIs. Requires Unity 6000.0.66f2 or newer and the Meta XR Core SDK. Includes samples for Firebase Analytics and Crashlytics integration, as well as guides for building and deploying APKs to Meta Quest devices.

Tokens
827
Snippets
1
Records
9
Agent score
4%

What's inside Unity Starter Samples

  1. Run the Unity Starter Samples project

    main

    To explore the samples within the Unity Editor:

    1. Ensure you are using Unity 6000.0.66f2 or a newer version.
    2. In the Unity Project window, navigate to Assets/StarterSamples/Usage.
    3. Open individual scenes.
    4. Press the Play button in the Unity Editor to test the scene functionality.
  2. Install Firebase Analytics and Crashlytics for Unity

    main

    To use the Firebase sample, you must first integrate the Firebase SDK into your Unity project. Follow these steps:

    1. Follow the official Firebase Unity Setup guide (steps 1 through 4).
    2. From your downloaded firebase_unity_sdk, import the following packages into your project:
      • dotnet4/FirebaseAnalytics.unitypackage
      • dotnet4/FirebaseCrashlytics.unitypackage
    3. If prompted, ensure you enable the Android Auto-Resolver.
    4. Replace the template google-services.json file in your project with your own configuration file downloaded from the Firebase console.
  3. Integrate Starter Samples into your own project

    main

    Before integrating, ensure your project uses the same Meta SDK version as the samples.

    Option 1: Copying the directory

    1. Copy the Assets/StarterSamples directory directly into your project's Assets folder.

    Option 2: Using a UnityPackage

    1. Open the Unity-StarterSamples project in Unity.
    2. Right-click the Assets/StarterSamples folder and select Export Package....
    3. Save the .unitypackage file.
    4. Open your target project.
    5. Go to Assets > Import Package > Custom Package... from the menu bar.
    6. Select the saved package and click Open.
  4. Test samples on a Meta Quest device

    main

    You can test the samples on a physical device using two methods:

    Method 1: Build the Starter Scene APK

    Use the built-in menu to generate a single APK that allows you to cycle through different sample scenes on the device:

    1. In Unity, navigate to Meta > Samples > Build Starter Scene.
    2. This builds an APK containing the Starter Scene.

    Method 2: Manual APK Deployment

    1. Locate the StartScene.apk file within the Unity-StarterSamples folder.
    2. Copy the APK to your device using Meta Quest Developer Hub.