class ARNetworkingManager (Niantic.ARDK.Extensions.ARNetworkingManager)
Overview
A Unity component that manages an ARNetworking's lifetime. The session can either be started automatically through Unity lifecycle events, or can be controlled programatically. Any outstanding sessions are always cleaned up on destruction. Integrates with the ARSessionManager and NetworkSessionManager to make sure all components are set up correctly. More...
class ARNetworkingManager: Niantic.ARDK.Extensions.ARConfigChanger { public: // fields ARSessionManager ARSessionManager => _arSessionManager; NetworkSessionManager NetworkSessionManager => _networkSessionManager; // properties IARNetworking ARNetworking; // 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 ARNetworking's lifetime. The session can either be started automatically through Unity lifecycle events, or can be controlled programatically. Any outstanding sessions are always cleaned up on destruction. Integrates with the ARSessionManager and NetworkSessionManager to make sure all components are set up correctly.
If ManageUsingUnityLifecycle is true: OnAwake(): An ARNetworking (and the component ARSession and MultipeerNetworking objects) will be initialized OnEnable(): The ARSession will be run and the MultipeerNetworking will join a session OnDisable(): The ARSession will be paused and the MultipeerNetworking will leave the session OnDestroy(): The ARNetworking (and the component ARSession and MultipeerNetworking objects) will be disposed Else: Call Initialize to: Initialize an ARNetworking (and the component ARSession and MultipeerNetworking objects) Call EnableFeatures to: Run the ARSession and join the MultipeerNetworking Call DisableFeatures to: Pause the ARSession and leave the MultipeerNetworking session Call Destroy to: Dispose the ARNetworking (and the component ARSession and MultipeerNetworking objects)
注釈
Because the CapabilityChecker's method for checking device support is async, the above events (i.e. initialization of ARNetworking) may not happen on the exact frame as the method (OnAwake or Initialize) is invoked.
Properties
IARNetworking ARNetworking
警告
Underlying object will change if this component is enabled (connected), disabled (disconnected), and then connected again (reconnected). If subscribing to IARNetworking events, you should listen to the ARNetworkingFactory.ARNetworkingInitialized event and add your IARNetworking event subscriptions to the latest initialized networking object.
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().