Struct ARCollaborationData
Represents the Objective-C type ARCollaborationData.
Inherited Members
Namespace: UnityEngine.XR.ARKit
Assembly: Unity.XR.ARKit.dll
Syntax
public struct ARCollaborationData : IDisposable, IEquatable<ARCollaborationData>
Remarks
This struct mirrors the Objective-C type ARCollaborationData. Because it represents a native resource, it must be explicitly disposed when no longer needed.
ARCollaborationData can be constructed from a byte array, or from DequeueCollaborationData().
This struct is not thread-safe, but it may be constructed and disposed on any thread.
Constructors
ARCollaborationData(byte[])
Constructs an ARCollaborationData from a byte array.
Check valid after construction to ensure bytes
was successfully deserialized.
Declaration
public ARCollaborationData(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | An array of |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
See Also
ARCollaborationData(byte[], int, int)
Constructs an ARCollaborationData from a byte array.
Check valid after construction to ensure bytes
was successfully deserialized.
Declaration
public ARCollaborationData(byte[] bytes, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | An array of |
int | offset | The offset into the |
int | length | The number of bytes in |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentOutOfRangeException | Thrown if |
ArgumentOutOfRangeException | Thrown if |
See Also
ARCollaborationData(NativeSlice<byte>)
Constructs an ARCollaborationData from a NativeSlice
of byte
s.
Check valid after construction to ensure bytes
was successfully deserialized.
Declaration
public ARCollaborationData(NativeSlice<byte> bytes)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<byte> | bytes | An array of |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
See Also
Properties
priority
Gets the priority of the collaboration data. Use this to determine how you should send the information to peers in a collaborative session (for example, reliably vs. unreliably.)
Declaration
public ARCollaborationDataPriority priority { get; }
Property Value
Type | Description |
---|---|
ARCollaborationDataPriority |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if valid is false. |
valid
True if the data is valid. The data might be invalid if this object was constructed with an invalid byte array, or if it has been disposed.
Declaration
public bool valid { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Dispose()
Dispose the native ARCollaborationData. valid will be false after disposal. It is safe to dispose an invalid or already disposed ARCollaborationData.
Declaration
public void Dispose()
Equals(object)
Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | An |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(ARCollaborationData)
Compares for equality.
Declaration
public bool Equals(ARCollaborationData other)
Parameters
Type | Name | Description |
---|---|---|
ARCollaborationData | other | The other ARCollaborationData to compare against. |
Returns
Type | Description |
---|---|
bool |
|
GetHashCode()
Generates a hash code suitable for use in HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash of the ARCollaborationData. |
Overrides
ToSerialized()
Copies the bytes that represent the serialized ARCollaborationData to a SerializedARCollaborationData. A common use case would be to send these bytes to another device over a network.
Declaration
public SerializedARCollaborationData ToSerialized()
Returns
Type | Description |
---|---|
SerializedARCollaborationData | A container that represents the serialized bytes of this ARCollaborationData. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if valid is false. |
Operators
operator ==(ARCollaborationData, ARCollaborationData)
Compares lhs
and rhs
for equality using Equals(ARCollaborationData).
Declaration
public static bool operator ==(ARCollaborationData lhs, ARCollaborationData rhs)
Parameters
Type | Name | Description |
---|---|---|
ARCollaborationData | lhs | The left-hand-side ARCollaborationData of the comparison. |
ARCollaborationData | rhs | The right-hand-side ARCollaborationData of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(ARCollaborationData, ARCollaborationData)
Compares lhs
and rhs
for inequality using Equals(ARCollaborationData).
Declaration
public static bool operator !=(ARCollaborationData lhs, ARCollaborationData rhs)
Parameters
Type | Name | Description |
---|---|---|
ARCollaborationData | lhs | The left-hand-side ARCollaborationData of the comparison. |
ARCollaborationData | rhs | The right-hand-side ARCollaborationData of the comparison. |
Returns
Type | Description |
---|---|
bool |
|