Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>
A base class for subsystems whose lifetime is managed by a MonoBehaviour
.
Inheritance
SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>
Inherited Members
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
Namespace: UnityEngine.XR.ARFoundation
Syntax
public class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor> : MonoBehaviour where TSubsystem : Subsystem<TSubsystemDescriptor> where TSubsystemDescriptor : SubsystemDescriptor<TSubsystem>
Type Parameters
Name | Description |
---|---|
TSubsystem | The |
TSubsystemDescriptor | The |
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()