docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ARCollaborationData

    Represents the Objective-C type ARCollaborationData.

    Implements
    IDisposable
    IEquatable<ARCollaborationData>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    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 bytes to convert to ARCollaborationData.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if bytes is null.

    See Also
    ToSerialized()

    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 bytes to convert to ARCollaborationData.

    int offset

    The offset into the bytes array from which to start constructing ARCollaborationData.

    int length

    The number of bytes in bytes to convert to ARCollaborationData.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if bytes is null.

    ArgumentOutOfRangeException

    Thrown if offset is outside the range [0..bytes.Length].

    ArgumentOutOfRangeException

    Thrown if length is outside the range [0..(bytes.Length - offset)].

    See Also
    ToSerialized()

    ARCollaborationData(NativeSlice<byte>)

    Constructs an ARCollaborationData from a NativeSlice of bytes. 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 bytes to convert to ARCollaborationData.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if bytes does not refer to valid data.

    See Also
    ToSerialized()

    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 object to compare against.

    Returns
    Type Description
    bool

    true if obj is an ARCollaborationData and Equals(ARCollaborationData) is also true. Otherwise, false.

    Overrides
    ValueType.Equals(object)

    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

    true if the ARCollaborationData represents the same object.

    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
    ValueType.GetHashCode()

    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

    true if lhs compares equal to rhs, false otherwise.

    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

    false if lhs compares equal to rhs, true otherwise.

    Implements

    IDisposable
    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)