docs.unity3d.com
    目次を表示する/隠す

    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.

    Inherited Members
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.ARFoundation
    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

    count

    Returns the number of trackables in this collection.

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

    Item[TrackableId]

    Retrieves a TTrackables by TrackableId.

    Declaration
    public readonly 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.

    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
    Boolean

    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
    Boolean

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

    Implements
    IEquatable<T>.Equals(T)

    GetEnumerator()

    Creates an Enumerator for this collection.

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

    GetHashCode()

    Retrieves the hashcode of the TrackableCollection<TTrackable>.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    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
    Boolean

    true if the trackable with trackableId exists. false otherwise.

    Operators

    Equality(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
    Boolean

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

    See Also
    Equals(TrackableCollection<TTrackable>)

    Inequality(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
    Boolean

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

    See Also
    Equals(TrackableCollection<TTrackable>)
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)