private void onAirXRPlayerDestroyed(int playerID, AirXRServerMessage message) { var unboundCameraRig = _cameraRigList.GetBoundCameraRig(playerID); if (unboundCameraRig != null) { if (unboundCameraRig.isStreaming && Delegate != null) { Delegate.AirXRCameraRigDeactivated(unboundCameraRig); } if (string.IsNullOrEmpty(unboundCameraRig.GetConfig().profileReportEndpoint) == false) { predictionEventHandler?.OnStopPrediction(unboundCameraRig); } unboundCameraRig.UnbindPlayer(); _cameraRigList.ReleaseCameraRig(unboundCameraRig); if (Delegate != null) { Delegate.AirXRCameraRigHasBeenUnbound(unboundCameraRig); } } }
internal void UnregisterCameraRig(AirXRCameraRig cameraRig, bool applicationQuit = false) { _cameraRigList.RemoveCameraRig(cameraRig); if (applicationQuit == false && cameraRig.isBoundToClient) { cameraRig.PreHandOverStreams(); AirXRServerStreamHandover.HandOverStreamsForNextScene(new AirXRServerStreamHandover.Streams(cameraRig.playerID, cameraRig.mediaStream, cameraRig.inputStream)); if (Delegate != null) { if (cameraRig.isStreaming) { Delegate.AirXRCameraRigDeactivated(cameraRig); } Delegate.AirXRCameraRigHasBeenUnbound(cameraRig); } cameraRig.PostHandOverStreams(); } }