Struct ARCollaborationData
Represents the Objective-C type ARCollaborationData.
Inherited Members
Namespace: UnityEngine.XR.ARKit
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[], Int32, Int32)
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 |
Int32 | offset | The offset into the |
Int32 | 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 |
---|---|---|
Unity.Collections.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 readonly 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 readonly bool valid { get; }
Property Value
Type | Description |
---|---|
Boolean |
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()
Implements
Equals(Object)
Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | An |
Returns
Type | Description |
---|---|
Boolean |
|
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 |
---|---|
Boolean |
|
Implements
GetHashCode()
Generates a hash code suitable for use in HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | 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
Equality(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 |
---|---|
Boolean |
|
Inequality(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 |
---|---|
Boolean |
|