NRSDKApiForUnity
Classes
PersistenceNRWorldAnchorStore

Inherits IDisposable.

Public Member Functions

void Dispose ()
 
bool CreateAnchor (NRWorldAnchor anchor)
 
void BindAnchor (NRWorldAnchor anchor, UInt64 handle)
 
bool SaveAnchor (NRWorldAnchor anchor)
 
bool SaveAllAnchors ()
 
bool DestroyAnchor (NRWorldAnchor anchor)
 
void Destroy ()
 
bool EraseAnchor (NRWorldAnchor anchor)
 
void LoadwithUUID (string uuid, Action< UInt64 > action)
 
Dictionary< string, string > GetLoadableAnchorUUID ()
 

Public Attributes

readonly string MapPath
 

Static Public Attributes

static NRWorldAnchorStore Instance
 
const string MapFolder = "XrealMaps"
 
const string Anchor2ObjectFile = "anchor2object.json"
 

Detailed Description

NR world anchor store.

Member Function Documentation

◆ BindAnchor()

void NRKernal.Persistence.NRWorldAnchorStore.BindAnchor ( NRWorldAnchor  anchor,
UInt64  handle 
)

Bind an anchor to an existing handle.

Parameters
anchorThe NRWorldAnchor to be associated with.
handleThe handle to be associated with.

◆ CreateAnchor()

bool NRKernal.Persistence.NRWorldAnchorStore.CreateAnchor ( NRWorldAnchor  anchor)

Creates an NRWorldAnchor.

Parameters
anchorThe NRWorldAnchor handler.
Returns
The new anchor.

◆ DestroyAnchor()

bool NRKernal.Persistence.NRWorldAnchorStore.DestroyAnchor ( NRWorldAnchor  anchor)

Destroy a NRWorldAnchor from the memory.

Parameters
anchorThe NRWorldAnchor to be destroyed.
Returns
True if it succeeds, false if it fails.

◆ EraseAnchor()

bool NRKernal.Persistence.NRWorldAnchorStore.EraseAnchor ( NRWorldAnchor  anchor)

Erase a NRWorldAnchor from disk

Returns
True if it succeeds, false if it fails.

◆ GetLoadableAnchorUUID()

Dictionary< string, string > NRKernal.Persistence.NRWorldAnchorStore.GetLoadableAnchorUUID ( )

Retrieves a dictionary of loadable anchor UUIDs that are not currently loaded in the session.

Returns
A dictionary of UUIDs and user-defined keys.

◆ LoadwithUUID()

void NRKernal.Persistence.NRWorldAnchorStore.LoadwithUUID ( string  uuid,
Action< UInt64 >  action 
)

Loads a NRWorldAnchor from disk for given identifier.

Parameters
uuidanchor uuid .
actionExecute in main thread after success load.

◆ SaveAllAnchors()

bool NRKernal.Persistence.NRWorldAnchorStore.SaveAllAnchors ( )

Saves all NRWorldAnchor.

Returns
True if it succeeds, false if it fails.

◆ SaveAnchor()

bool NRKernal.Persistence.NRWorldAnchorStore.SaveAnchor ( NRWorldAnchor  anchor)

Saves an NRWorldAnchor to the disk

Parameters
anchorThe NRWorldAnchor to be saved.
Returns
True if it succeeds, false if it fails.