class ARSessionFactory (Niantic.ARDK.AR.ARSessionFactory)

Overview

Class used to create ARSessions and also to be notified when new ARSessions are created. More...

class ARSessionFactory {
public:
    // properties

    ArdkEventHandler<AnyARSessionInitializedArgs> SessionInitialized;

    // methods

    static IARSession Create(Guid stageIdentifier = default);
    static IARSession Create(RuntimeEnvironment env, Guid stageIdentifier = default);
};

Detailed Documentation

Class used to create ARSessions and also to be notified when new ARSessions are created.

Properties

ArdkEventHandler<AnyARSessionInitializedArgs> SessionInitialized

Event invoked when a new session is created and initialized.

Methods

static IARSession Create(Guid stageIdentifier = default)

Create an ARSession appropriate for the current device.

On a mobile device, the attempted order will be LiveDevice, Remote, and finally Mock. In the Unity Editor, the attempted order will be Remote, then Mock.

Parameters:

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created session, or throws if it was not possible to create a session.

static IARSession Create(RuntimeEnvironment env, Guid stageIdentifier = default)

Create an ARSession for the specified RuntimeEnvironment.

Parameters:

env

The env used to create the session for.

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created session, or null if it was not possible to create a session.