# XRShareableAnchor

Represents a shareable anchor trackable by the shareable anchor subsystem.

## Summary

### Inheritance

Inherits from: `ITrackable`, `IEquatable< XRShareableAnchor >`

| ### Constructors and Destructors ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#xrshareableanchor(TrackableId id, Pose pose, TrackingState state, IntPtr nativePtr, TrackableId parentId, https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#xrshareableanchorhosts host, SerializableGuid shareableId)` Constructs a new [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor). ||
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#xrshareableanchor(TrackableId id, Pose pose, TrackingState state, IntPtr nativePtr, TrackableId parentId)` Constructs a default anchor. ||

| ### Public static attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#defaultvalue => new XRShareableAnchor( TrackableId.invalidId, Pose.identity, TrackingState.None, IntPtr.Zero, TrackableId.invalidId)` | `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor` Gets a default-initialized [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor). |

| ### Public attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#host => _host` | `https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#xrshareableanchorhosts` Gets the host of this shareable anchor. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#nativeptr => _nativePtr` | `IntPtr` Gets a native pointer to additional provider-specific data. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#parentid => _parentId` | `TrackableId` Gets the TrackableId of the parent of this tracked object. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#pose => _pose` | `Pose` Gets the pose of the shareable anchor in the Unity world space. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#shareableid => _shareableId` | `SerializableGuid` Gets the shareable ID to retrieve the anchor from other clients. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#trackableid => _trackableId` | `TrackableId` Gets the unique identifier for this shareable anchor. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#trackingstate => _state` | `TrackingState` Gets the current tracking state of the shareable anchor. |

| ### Public functions ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#equals(https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor other)` | `bool` Indicates whether every field in this [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) is equal to the corresponding field in *other* . |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#equals(object obj)` | `override bool` |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#gethashcode()` | `override int` |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#updatehost(https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#xrshareableanchorhosts host, SerializableGuid shareableId)` | `void` Updates host information for a default anchor. |

| ### Public static functions ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#operator!=(https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor left, https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor right)` | `bool` Determines whether two [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) instances have different property values. |
| `https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#operator==(https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor left, https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor right)` | `bool` Determines whether two [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) instances have exactly the same property values. |

## Public static attributes

### defaultValue

```c#
XRShareableAnchor Google::XR::Extensions::ARSubsystems::XRShareableAnchor::defaultValue =>
            new XRShareableAnchor(
                TrackableId.invalidId,
                Pose.identity,
                TrackingState.None,
                IntPtr.Zero,
                TrackableId.invalidId)
```
Gets a default-initialized [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor).

## Public attributes

### host

```c#
XRShareableAnchorHosts Google::XR::Extensions::ARSubsystems::XRShareableAnchor::host => _host
```
Gets the host of this shareable anchor.

### nativePtr

```c#
IntPtr Google::XR::Extensions::ARSubsystems::XRShareableAnchor::nativePtr => _nativePtr
```
Gets a native pointer to additional provider-specific data.

May be IntPtr.Zero.

### parentId

```c#
TrackableId Google::XR::Extensions::ARSubsystems::XRShareableAnchor::parentId => _parentId
```
Gets the TrackableId of the parent of this tracked object.

May be TrackableId.invalidId.

### pose

```c#
Pose Google::XR::Extensions::ARSubsystems::XRShareableAnchor::pose => _pose
```
Gets the pose of the shareable anchor in the Unity world space.

### shareableId

```c#
SerializableGuid Google::XR::Extensions::ARSubsystems::XRShareableAnchor::shareableId => _shareableId
```
Gets the shareable ID to retrieve the anchor from other clients.

### trackableId

```c#
TrackableId Google::XR::Extensions::ARSubsystems::XRShareableAnchor::trackableId => _trackableId
```
Gets the unique identifier for this shareable anchor.

### trackingState

```c#
TrackingState Google::XR::Extensions::ARSubsystems::XRShareableAnchor::trackingState => _state
```
Gets the current tracking state of the shareable anchor.

## Public functions

### Equals

```c#
bool Google::XR::Extensions::ARSubsystems::XRShareableAnchor::Equals(
  XRShareableAnchor other
)
```
Indicates whether every field in this [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) is equal to the corresponding field in *other* .


Details Parameters `other` The [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) to compare with. **Returns** Returns true if all properties match. Otherwise, returns false.

### Equals

```c#
override bool Google::XR::Extensions::ARSubsystems::XRShareableAnchor::Equals(
  object obj
)
```

### GetHashCode

```c#
override int Google::XR::Extensions::ARSubsystems::XRShareableAnchor::GetHashCode()
```

### UpdateHost

```c#
void Google::XR::Extensions::ARSubsystems::XRShareableAnchor::UpdateHost(
  XRShareableAnchorHosts host,
  SerializableGuid shareableId
)
```
Updates host information for a default anchor.


Details Parameters `host` The host of this shareable anchor. `shareableId` The shareable identifier of this anchor.

### XRShareableAnchor

```c#
 Google::XR::Extensions::ARSubsystems::XRShareableAnchor::XRShareableAnchor(
  TrackableId id,
  Pose pose,
  TrackingState state,
  IntPtr nativePtr,
  TrackableId parentId,
  XRShareableAnchorHosts host,
  SerializableGuid shareableId
)
```
Constructs a new [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor).


Details Parameters `id` The unique identifier for this shareable anchor. `pose` The pose of the shareable anchor in the Unity world space. `state` The current tracking state of the shareable anchor. `nativePtr` Provider-specific native pointer, or IntPtr.Zero. `parentId` The TrackableId of the parent of this tracked object, or TrackableId.invalidId. `host` The host of this shareable anchor. `shareableId` The shareable identifier of this anchor.

### XRShareableAnchor

```c#
 Google::XR::Extensions::ARSubsystems::XRShareableAnchor::XRShareableAnchor(
  TrackableId id,
  Pose pose,
  TrackingState state,
  IntPtr nativePtr,
  TrackableId parentId
)
```
Constructs a default anchor.


Details Parameters `id` The unique identifier for this shareable anchor. `pose` The pose of the shareable anchor in the Unity world space. `state` The current tracking state of the shareable anchor. `nativePtr` Provider-specific native pointer, or IntPtr.Zero. `parentId` The TrackableId of the parent of this tracked object, or TrackableId.invalidId.

## Public static functions

### operator!=

```c#
bool Google::XR::Extensions::ARSubsystems::XRShareableAnchor::operator!=(
  XRShareableAnchor left,
  XRShareableAnchor right
)
```
Determines whether two [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) instances have different property values.


Details Parameters `left` The first trackable to compare. `right` The second trackable to compare. **Returns** Returns true if any property differs. Otherwise, returns false.

### operator==

```c#
bool Google::XR::Extensions::ARSubsystems::XRShareableAnchor::operator==(
  XRShareableAnchor left,
  XRShareableAnchor right
)
```
Determines whether two [XRShareableAnchor](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/ARSubsystems/XRShareableAnchor#structGoogle_1_1XR_1_1Extensions_1_1ARSubsystems_1_1XRShareableAnchor) instances have exactly the same property values.


Details Parameters `left` The first trackable to compare. `right` The second trackable to compare. **Returns** Returns true if all properties match. Otherwise, returns false.