Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>
A base class for subsystems whose lifetime is managed by a MonoBehaviour
.
Namespace: UnityEngine.XR.InteractionSubsystems
Syntax
public class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor> : MonoBehaviour where TSubsystem : Subsystem<TSubsystemDescriptor> where TSubsystemDescriptor : SubsystemDescriptor<TSubsystem>
Type Parameters
Name | Description |
---|---|
TSubsystem | The |
TSubsystemDescriptor | The |
Properties
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()
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()