Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>
A base class for subsystems whose lifetime is managed by a MonoBehaviour
.
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
CreateSubsystem()
Creates a TSubsystem
.
Declaration
protected virtual TSubsystem CreateSubsystem()
Returns
Type | Description |
---|---|
TSubsystem | The first Subsystem of matching the |
CreateSubsystemIfNecessary()
Creates a subsystem if subsystem is null
.
Declaration
protected void CreateSubsystemIfNecessary()
GetActiveSubsystemInstance()
Returns the active TSubsystem
instance if present, otherwise returns null.
Declaration
protected TSubsystem GetActiveSubsystemInstance()
Returns
Type | Description |
---|---|
TSubsystem |
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()