Struct ARCollaborationDataBuilder
Use this to construct an ARCollaboration
Inherited Members
Namespace: UnityEngine .XR.ARKit
Assembly: Unity.XR.ARKit.dll
Syntax
public struct ARCollaborationDataBuilder : IDisposable, IEquatable<ARCollaborationDataBuilder>
Remarks
This struct can be useful if you receive data through a stream. If you already have all
the bytes, use a ARCollaboration
Properties
hasData
Whether the ARCollaborationtrue
,
this struct must be disposed to avoid leaking native resources. If false
, this struct
either never allocated memory
(with Append(byte[], int, int) or Append(Native
Declaration
public bool hasData { get; }
Property Value
Type | Description |
---|---|
bool |
length
The number of bytes owned by this struct.
Declaration
public int length { get; }
Property Value
Type | Description |
---|---|
int |
See Also
Methods
Append(byte[])
Appends all bytes of the array buffer
to an existing array of bytes.
Declaration
public void Append(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | A buffer containing bytes to append. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Append(byte[], int, int)
Appends size
bytes of the array buffer
to an existing array of bytes.
Declaration
public void Append(byte[] buffer, int offset, int size)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | A buffer containing bytes to append. |
int | offset | The offset within |
int | size | The number of bytes from |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Argument |
Thrown if |
Argument |
Thrown if |
Invalid |
Thrown if |
Append(NativeSlice<byte>)
Appends bytes
to an existing array of bytes.
Declaration
public void Append(NativeSlice<byte> bytes)
Parameters
Type | Name | Description |
---|---|---|
Native |
bytes | An array of bytes to append to the existing data. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Dispose()
Releases the native resource.
Declaration
public void Dispose()
Equals(object)
Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare for equality. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
Equals(ARCollaborationDataBuilder)
Compares for equality.
Declaration
public bool Equals(ARCollaborationDataBuilder other)
Parameters
Type | Name | Description |
---|---|---|
ARCollaboration |
other | The ARCollaboration |
Returns
Type | Description |
---|---|
bool | true if all fields of this instance compare equal to |
GetHashCode()
Computes a hash code suitable for use in a Dictionary
or HashSet
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code for this instance. |
Overrides
ToCollaborationData()
Converts the bytes accumulated through calls to Append(byte[], int, int) to an ARCollaboration
Declaration
public ARCollaborationData ToCollaborationData()
Returns
Type | Description |
---|---|
ARCollaboration |
A new ARCollaboration |
Exceptions
Type | Condition |
---|---|
Not |
Thrown if ARCollaboration |
Invalid |
Thrown if has |
Operators
operator ==(ARCollaborationDataBuilder, ARCollaborationDataBuilder)
Compares for equality. Equivalent to Equals(ARCollaboration
Declaration
public static bool operator ==(ARCollaborationDataBuilder lhs, ARCollaborationDataBuilder rhs)
Parameters
Type | Name | Description |
---|---|---|
ARCollaboration |
lhs | The left-hand side of the comparison. |
ARCollaboration |
rhs | The right-hand side of the comparison. |
Returns
operator !=(ARCollaborationDataBuilder, ARCollaborationDataBuilder)
Compares for inequality. Equivalent to !
Equals(ARCollaboration
Declaration
public static bool operator !=(ARCollaborationDataBuilder lhs, ARCollaborationDataBuilder rhs)
Parameters
Type | Name | Description |
---|---|---|
ARCollaboration |
lhs | The left-hand side of the comparison. |
ARCollaboration |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool | true if any of the fields of the instances are not equal. Otherwise, returns false. |