🕶️
NRSDK(Old)
New DocumentationSDK DownloadAPI Reference
v2.1.0
v2.1.0
  • NRSDK Fundamentals
    • NRSDK Overview
    • XREAL Devices
      • XREAL Glasses
      • Controller
      • Compatibility
    • Getting Started with NRSDK
    • Sample Code
    • Tutorials
    • Release Note
      • NRSDK 2.1.1
      • NRSDK 2.1.0
      • NRSDK 1.10.2
      • NRSDK 1.9.5
      • NRSDK 1.9.3
      • NRSDK 1.9.1
      • NRSDK 1.8.0
      • NRSDK 1.7.0
      • NRSDK 1.6.0
  • Development
    • Input and Camera
      • NRInput
      • Interact with Unity UI (Tutorial)
      • Customize Controller UI
      • NRCameraRig
    • Hand Tracking
    • Image Tracking
    • Plane Detection (Tutorial)
      • Overview
      • Import the package
      • Detect planes in the real world
      • Perform a hit test against detected planes
      • Add a car
      • Add gems
      • Wrap up
    • Depth Mesh
      • Meshing Manager Overview
      • Use Meshes in the Editor
      • Tutorial: Mesh Collision
    • Spatial Anchor
      • Mapping Example Scene
      • Tutorial: Halloween Treasure Hunt
        • Handle the Situation of Failed Anchor Saving
      • Tutorial: Sharing Anchors
        • Setting Up Photon
        • Cloud Storage: Firebase (optional)
        • Cloud Storage: Aliyun OSS (optional)
        • Implementing Cloud Save and Load
        • Sharing Anchors with Photon
    • Tools
      • Single Pass Stereo Rendering
      • First Person View
      • Emulator
      • XR Streaming
    • Miscellaneous
      • Access RGB Camera
      • NRSDK Coordinate Systems
      • MRTK Integration
      • Notification popup
      • Reset Camera
      • Render Metrics
      • Render MonoMode
  • API Reference
  • Frequently Asked Questions
  • DESIGN GUIDE
    • Design Guide Overview
    • Displaying
    • Interacting
    • Controlling
    • Navigating
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • All Materials Needed in This Tutorial

Was this helpful?

  1. Development
  2. Spatial Anchor

Tutorial: Sharing Anchors

Introduction

Sharing anchors between devices is essential for multi-user AR experiences. This tutorial will guide you through the process of sharing anchors by using Photon to transmit anchor UUIDs in real-time and cloud storage to persistently store the anchor data.

At a high level, the process works as follows:

  1. When a user creates an anchor, its UUID is sent to other users in the same Photon room.

  2. The anchor data is then stored in a cloud storage solution.

  3. Other users in the room, upon receiving the UUID, access the cloud storage to download the anchor data.

  4. Once downloaded, the anchor is loaded into their AR scene, effectively sharing the anchor across devices.

For the cloud storage part, any cloud storage provider that allows file upload and download can be used. In this tutorial, we provide examples for two cloud storage solutions:

  • Firebase

  • Alibaba Cloud OSS.

The methods for other providers should be similar, and developers are encouraged to explore the options that best suit their needs.

Prerequisites

  • Unity with NRSDK 2.1 installed.

  • Photon Unity Networking 2 (PUN 2) package.

  • Firebase Unity SDK.

All Materials Needed in This Tutorial

PreviousHandle the Situation of Failed Anchor SavingNextSetting Up Photon

Last updated 1 year ago

Was this helpful?

The following package includes all the necessary scene and the majority of the scripts required for this tutorial. However, it's important to note that developers will still need to complete the steps related to and cloud storage themselves.

Additionally, due to the tutorial's involvement with modifications to the built-in scripts of NRSDK, specifically NRWorldAnchor.cs and NRWorldAnchorStore.cs, these changes cannot be included within this package. Please refer to the tutorial's content, specifically in the section on ',' to make the necessary modifications.

photon
Implementing Cloud Save and Load
20MB
ShareAnchor.unitypackage