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>
Type Parameters
Name | Description |
---|---|
TTrackable | The concrete ARTrackable<TSessionRelativeData, TTrackable>. |
Constructors
TrackableCollection(Dictionary<TrackableId, TTrackable>)
Constructs a
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
GetEnumerator()
Creates an Enumerator
for this collection.
Declaration
public TrackableCollection<TTrackable>.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
TrackableCollection.Enumerator<> |
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 |
|