Class ARTrackableManager<TSubsystem, TSubsystemDescriptor, TProvider, TSessionRelativeData, TTrackable>
A generic manager for components generated by features detected in the physical environment.
Inheritance
Inherited Members
Namespace: UnityEngine .XR.ARFoundation
Assembly: solution.dll
Syntax
[RequireComponent(typeof(ARSessionOrigin))]
[DisallowMultipleComponent]
public abstract class ARTrackableManager<TSubsystem, TSubsystemDescriptor, TProvider, TSessionRelativeData, TTrackable> : SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor, TProvider> where TSubsystem : TrackingSubsystem<TSessionRelativeData, TSubsystem, TSubsystemDescriptor, TProvider>, new() where TSubsystemDescriptor : SubsystemDescriptorWithProvider<TSubsystem, TProvider> where TProvider : SubsystemProvider<TSubsystem> where TSessionRelativeData : struct, ITrackable where TTrackable : ARTrackable<TSessionRelativeData, TTrackable>
Type Parameters
Name | Description |
---|---|
TSubsystem | The |
TSubsystemDescriptor | The |
TProvider | The provider associated with the |
TSessionRelativeData | A concrete struct used to hold data provided by the Subsystem. |
TTrackable | The type of component that this component will manage (that is, create, update, and destroy). |
Remarks
When the manager is informed that a trackable has been added, a new GameObject
is created with an ARTrackable
component on it. If
ARTrackable
Fields
Name | Description |
---|---|
m_Pending |
A dictionary of trackables added via Create |
m_Trackables | A dictionary of all trackables, keyed by |
Properties
Name | Description |
---|---|
game |
The name prefix that should be used when instantiating new |
session |
The |
trackables | A collection of all trackables managed by this component. |
Methods
Name | Description |
---|---|
Awake() | Invoked by Unity once when this component wakes up. |
Can |
Determines whether an existing ARTrackable<TSession |
Create |
Creates the native counterpart for an existing ARTrackable<TSession |
Create |
Creates a |
Destroy |
If in a "pending" state and destroy |
Get |
The Prefab that should be instantiated when adding a trackable. Can be |
On |
Invoked just after session-relative data has been set on a trackable. |
On |
Invoked after creating the trackable. The trackable's |
On |
Stops the |
On |
Creates the |
On |
Invoked when trackables have change (that is, they were added, updated, or removed). Use this to perform additional logic, or to invoke public events related to your trackables. |
Set |
Iterates over every instantiated ARTrackable<TSession |
Update() | Update is called once per frame. This component's internal state is first updated, and then an event notifying whether any trackables have been added, removed, or updated is invoked by the derived manager. |