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
Inherited Members
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 |
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 |
|
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 |
|---|---|
| bool |
|
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 |
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 |
|---|---|
| bool |
|
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 |
|
See Also
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 |
|