class ARSessionManager (Niantic.ARDK.Extensions.ARSessionManager)

Overview

A Unity component that manages an ARSession's lifetime. The session can either be created and run automatically through Unity lifecycle events, or can be controlled programatically. Any outstanding sessions are always cleaned up on destruction. Integrates with the CapabilityChecker to ensure the device supports AR. More...

class ARSessionManager: Niantic.ARDK.Extensions.ARConfigChanger {
public:
    // properties

    IARSession ARSession;
    bool IsAutoFocusEnabled;
    bool IsLightEstimationEnabled;
    ARSessionRunOptions RunOptions;
    WorldAlignment WorldAlignment;

    // methods

    virtual override void ApplyARConfigurationChange(ARSessionChangesCollector.ARSessionRunProperties properties);
};

Inherited Members

public:
    // properties

    bool AreFeaturesEnabled;
    bool CanInitialize;
    bool Initialized;

    // methods

    void Deinitialize();
    void DisableFeatures();
    void EnableFeatures();
    void Initialize();
    virtual abstract void ApplyARConfigurationChange(ARSessionChangesCollector.ARSessionRunProperties properties) = 0;

Detailed Documentation

A Unity component that manages an ARSession's lifetime. The session can either be created and run automatically through Unity lifecycle events, or can be controlled programatically. Any outstanding sessions are always cleaned up on destruction. Integrates with the CapabilityChecker to ensure the device supports AR.

If ManageUsingUnityLifecycle is true: OnAwake(): an ARSession will be initialized OnEnable(): the ARSession will be run OnDisable(): the ARSession will be paused OnDestroy(): the ARSession will be disposed Else: Call Initialize() to initialize an ARSession Call EnableFeatures() to run the ARSession Call DisableFeatures() to pause the ARSession Call Deinitialize() to dispose the ARSession

注釈

Because the CapabilityChecker's method for checking device support and the PermissionRequester's method to get camera permissions are async, the above events (i.e. initialization of an ARSession) may not happen on the exact frame as the method (OnAwake or Initialize) is invoked.

Methods

virtual override void ApplyARConfigurationChange(ARSessionChangesCollector.ARSessionRunProperties properties)

Inheritors should override this to modify session configuration settings based on their script's needs.

注釈

This is executed as a result of the ARSession being run, which may or may not be triggered by a call to RaiseConfigurationChanged().