Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor> | AR Foundation | 2.2.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>

    A base class for subsystems whose lifetime is managed by a MonoBehaviour.

    Inheritance
    Object
    SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor>
    ARCameraManager
    ARRaycastManager
    ARSession
    ARTrackableManager<TSubsystem, TSubsystemDescriptor, TSessionRelativeData, TTrackable>
    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 Subsystem which provides this manager data.

    TSubsystemDescriptor

    The SubsystemDescriptor required to create the 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

    CreateSubsystem()

    Creates a TSubsystem.

    Declaration
    protected virtual TSubsystem CreateSubsystem()
    Returns
    Type Description
    TSubsystem

    The first Subsystem of matching the TSubsystemDescriptor, or null if there aren't any.

    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()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023