docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct TrackableCollection<TTrackable>

    A collection for ARTrackable<TSessionRelativeData, TTrackable>s. This collection implements an IEnumerable-like interface which can be used in a foreach statement.

    Implements
    IEquatable<TrackableCollection<TTrackable>>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    public struct TrackableCollection<TTrackable> : IEquatable<TrackableCollection<TTrackable>>
    Type Parameters
    Name Description
    TTrackable

    The concrete ARTrackable<TSessionRelativeData, TTrackable>.

    Constructors

    TrackableCollection(Dictionary<TrackableId, TTrackable>)

    Constructs a TrackableCollection<TTrackable>.

    Declaration
    public TrackableCollection(Dictionary<TrackableId, TTrackable> trackables)
    Parameters
    Type Name Description
    Dictionary<TrackableId, TTrackable> trackables

    Properties

    this[TrackableId]

    Retrieves a TTrackables by TrackableId.

    Declaration
    public TTrackable this[TrackableId trackableId] { get; }
    Parameters
    Type Name Description
    TrackableId trackableId

    The trackable id associated with the trackable to retrieve.

    Property Value
    Type Description
    TTrackable

    The TTrackables if present. Throws KeyNotFoundException if the trackableId is not found.

    count

    Returns the number of trackables in this collection.

    Declaration
    public int count { get; }
    Property Value
    Type Description
    int

    Methods

    Equals(object)

    Checks the equality of this object against this TrackableCollection<TTrackable>.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object that this collection should be checked against for equivalency.

    Returns
    Type Description
    bool

    true if the object is a TrackableCollection<TTrackable> and is considered equivalent to this and false otherwise.

    Overrides
    ValueType.Equals(object)

    Equals(TrackableCollection<TTrackable>)

    Checks the equality of this TrackableCollection<TTrackable> against another TrackableCollection<TTrackable> of the same TTrackable generic type.

    Declaration
    public bool Equals(TrackableCollection<TTrackable> other)
    Parameters
    Type Name Description
    TrackableCollection<TTrackable> other

    The TrackableCollection<TTrackable> that this collection should be checked against for equivalency.

    Returns
    Type Description
    bool

    true if the two TrackableCollection<TTrackable>s are considered equivalent and false otherwise.

    GetEnumerator()

    Creates an Enumerator for this collection.

    Declaration
    public TrackableCollection<TTrackable>.Enumerator GetEnumerator()
    Returns
    Type Description
    TrackableCollection<TTrackable>.Enumerator

    GetHashCode()

    Retrieves the hashcode of the TrackableCollection<TTrackable>.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The hashcode of if the TrackableCollection<TTrackable> is instantiated and 0 if it is null.

    Overrides
    ValueType.GetHashCode()

    TryGetTrackable(TrackableId, out TTrackable)

    Attempts to retrieve a trackable by TrackableId.

    Declaration
    public bool TryGetTrackable(TrackableId trackableId, out TTrackable trackable)
    Parameters
    Type Name Description
    TrackableId trackableId

    The trackable id associated with the trackable to retrieve.

    TTrackable trackable

    Set to the trackable with trackableId, if present in the collection.

    Returns
    Type Description
    bool

    true if the trackable with trackableId exists. false otherwise.

    Operators

    operator ==(TrackableCollection<TTrackable>, TrackableCollection<TTrackable>)

    Overloads the == operator to use the equals method for equality checking.

    Declaration
    public static bool operator ==(TrackableCollection<TTrackable> lhs, TrackableCollection<TTrackable> rhs)
    Parameters
    Type Name Description
    TrackableCollection<TTrackable> lhs

    The TrackableCollection<TTrackable> on the left hand side of the operator.

    TrackableCollection<TTrackable> rhs

    The TrackableCollection<TTrackable> on the right hand side of the operator.

    Returns
    Type Description
    bool

    true if the two TrackableCollection<TTrackable>s are considered equivalent and false otherwise.

    See Also
    Equals(TrackableCollection<TTrackable>)

    operator !=(TrackableCollection<TTrackable>, TrackableCollection<TTrackable>)

    Overloads the != operator to use the equals method for equality checking.

    Declaration
    public static bool operator !=(TrackableCollection<TTrackable> lhs, TrackableCollection<TTrackable> rhs)
    Parameters
    Type Name Description
    TrackableCollection<TTrackable> lhs

    The TrackableCollection<TTrackable> on the left hand side of the operator.

    TrackableCollection<TTrackable> rhs

    The TrackableCollection<TTrackable> on the right hand side of the operator.

    Returns
    Type Description
    bool

    true if the two TrackableCollection<TTrackable>s are not considered equivalent and false otherwise.

    See Also
    Equals(TrackableCollection<TTrackable>)

    Implements

    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)