Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor, TProvider>
A base class for subsystems whose lifetime is managed by a MonoBehaviour
.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
public class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor, TProvider> : MonoBehaviour where TSubsystem : SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>, new()
where TSubsystemDescriptor : SubsystemDescriptorWithProvider<TSubsystem, TProvider> where TProvider : SubsystemProvider<TSubsystem>
Type Parameters
Name | Description |
---|---|
TSubsystem | The Subsystem which provides this manager data. |
TSubsystemDescriptor | The |
TProvider | The provider associated with this subsystem. |
Properties
descriptor
The descriptor for the subsystem.
Declaration
public TSubsystemDescriptor descriptor { get; }
Property Value
Type | Description |
---|---|
TSubsystemDescriptor | The descriptor for the subsystem. |
subsystem
Get the TSubsystem
whose lifetime this component manages.
Declaration
public TSubsystem subsystem { get; }
Property Value
Type | Description |
---|---|
TSubsystem |
Methods
EnsureSubsystemInstanceSet()
Called by derived classes to initialize the subsystem is initialized before use
Declaration
protected void EnsureSubsystemInstanceSet()
GetActiveSubsystemInstance()
Returns the active TSubsystem
instance if present, otherwise returns null.
Declaration
protected TSubsystem GetActiveSubsystemInstance()
Returns
Type | Description |
---|---|
TSubsystem | The active subsystem instance, or |
OnAfterStart()
Invoked after calling Start on it the Subsystem.
The subsystem is not null
.
Declaration
protected virtual void OnAfterStart()
OnBeforeStart()
Invoked after creating the subsystem and before calling Start on it.
The subsystem is not null
.
Declaration
protected virtual void OnBeforeStart()
OnDestroy()
Destroys the TSubsystem
.
Declaration
protected virtual void OnDestroy()
OnDisable()
Stops the TSubsystem
.
Declaration
protected virtual void OnDisable()
OnEnable()
Creates the TSubsystem
.
Declaration
protected virtual void OnEnable()