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.
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 TTrackable
s 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 |
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 |
|
Overrides
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 |
|
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 |
Overrides
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 |
Returns
Type | Description |
---|---|
Boolean |
|
Operators
Equality(TrackableCollection<TTrackable>, TrackableCollection<TTrackable>)
Overloads the ==
operator to utilize 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 |
|
See Also
Inequality(TrackableCollection<TTrackable>, TrackableCollection<TTrackable>)
Overloads the !=
operator to utilize 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 |
|