API reference
API reference
Select your platform
No SDKs available
No versions available

OVRStorable Struct

Extends IOVRAnchorComponent< OVRStorable >, IEquatable< OVRStorable >
Represents the ability to store (save) an OVRAnchor.
Savable anchors support this component type. In order to save (that is, persist) an anchor (OVRAnchor.SaveAsync() or OVRAnchor.SaveAsync(System.Collections.Generic.IEnumerable<OVRAnchor>)), you must first enable its storable component.
Note: The OVRSpatialAnchor component provides a higher level abstraction for the OVRAnchor type and automatically enables the storable component. You do not need to use this component when using an OVRSpatialAnchor.
This example obtains an anchor's storable component and enables it:
async void EnableSaving(OVRAnchor anchor) {
if (!anchor.TryGetComponent\<OVRStorable\>(out var storableComponent)) {
    Debug.LogError("Anchor does not support persistence.");
return;
  }
if (await storableComponent.SetEnabledAsync(true)) {
    Debug.Log("Anchor is now savable.");
  } else {
    Debug.LogError("Unable to enable the storable component.");
  }
}

Public Statics

A null representation of an OVRStorable.
Use this to compare with another component to determine whether it is null.

Properties

Whether this object represents a valid anchor component.
True if this component is enabled and no change to its enabled status is pending.
SpaceComponentType Type[Get]
ulong Handle[Get]

Member Functions

Sets the enabled status of this component.
A component must be enabled in order to access its data or do enable its functionality.This method is asynchronous. Use the returned task to track the completion of this operation. The task's value indicates whether the operation was successful.If the current enabled state matches enabled , then the returned task completes immediately with a true result. If there is already a pending change to the enabled state, the new request is queued.
Parameters
enabled
The desired state of the component.
timeout
The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
Returns an OVRTask<bool> whose result indicates the result of the operation.
(Obsolete) Sets the enabled status of this component if it differs from the current enabled state.
This method is obsolete. Use SetEnabledAsync instead.
Parameters
enabled
The desired state of the component.
timeout
The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
Returns an OVRTask<bool> whose result indicates the result of the operation.
Compares this component for equality with other .
Parameters
other
The other component to compare with.
Returns
True if both components belong to the same OVRAnchor, otherwise false.
Compares this component for equality with obj .
Parameters
obj
The object to compare with.
Returns
True if obj is an OVRStorable and Equals(OVRStorable) is true, otherwise false.
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this component.
Gets a string representation of this component.
Returns
A string representation of this component.

Static Member Functions

Compares two components for equality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if both components belong to the same OVRAnchor, otherwise false.
Compares two components for inequality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if the components do not belong to the same OVRAnchor, otherwise false.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon