class NetworkSessionManager (Niantic.ARDK.Extensions.NetworkSessionManager)

Overview

Initializes, connects, runs, and disposes a MultipeerNetworking object either according to the Unity lifecycle of this component, or when scripted to do so. More...

class NetworkSessionManager: Niantic.ARDK.Extensions.UnityLifecycleDriver {
public:
    // properties

    IMultipeerNetworking Networking;
    RuntimeEnvironment RuntimeEnvironment;
    string SessionIdentifier;

    // methods

    void SetSessionIdentifier(string sessionIdentifier);
};

Inherited Members

public:
    // properties

    bool AreFeaturesEnabled;
    bool CanInitialize;
    bool Initialized;

    // methods

    void Deinitialize();
    void DisableFeatures();
    void EnableFeatures();
    void Initialize();

Detailed Documentation

Initializes, connects, runs, and disposes a MultipeerNetworking object either according to the Unity lifecycle of this component, or when scripted to do so.

If ManageUsingUnityLifecycle is true: OnAwake(): a MultipeerNetworking instance will be initialized OnEnable(): the MultipeerNetworking will attempt to join a session OnDisable(): the MultipeerNetworking will leave the session OnDestroy(): the MultipeerNetworking will be disposed Else: Call Initialize() to initialize a MultipeerNetworking instance Call EnableFeatures() to join a networking session Call DisableFeatures() to leave the networking session Call Deinitialize() to dispose the MultipeerNetworking instance

注釈

A MultipeerNetworking instance cannot leave a session and be re-used to join a session again, so OnEnable/EnableFeatures will initialize a new MultipeerNetworking instance if the existing one has left a session.

Properties

IMultipeerNetworking Networking

警告

Underlying object will change if this component is enabled (connected), disabled (disconnected), and then connected again (reconnected). If subscribing to IMultipeerNetworking events, you should listen to the MultipeerNetworkingFactory.NetworkingInitialized event and add your IMultipeerNetworking event subscriptions to the latest initialized networking object.