void Start() { var streams = new List <AirXRServerStreamHandover.Streams>(); AirXRServerStreamHandover.TakeAllStreamsHandedOverInPrevScene(streams); foreach (var item in streams) { var selected = notifyCameraRigWillBeBound(item.playerID); if (selected != null) { _cameraRigList.RetainCameraRig(selected); selected.BindPlayer(item.playerID, item.mediaStream, item.inputStream); if (selected.isStreaming && Delegate != null) { Delegate.AirXRCameraRigActivated(selected); } } else { AXRServerPlugin.Disconnect(item.playerID); } } updateApplicationTargetFrameRate(); eventDispatcher.MessageReceived += onAirXRMessageReceived; }
public void Disconnect() { if (isBoundToClient) { AXRServerPlugin.Disconnect(playerID); } }
private void onAirXRPlayerCreated(int playerID, AirXRServerMessage message) { var selected = notifyCameraRigWillBeBound(playerID); if (selected != null) { _cameraRigList.RetainCameraRig(selected); selected.BindPlayer(playerID); AXRServerPlugin.AcceptPlayer(playerID); var config = selected.GetConfig(); if (string.IsNullOrEmpty(config.profileReportEndpoint) == false && string.IsNullOrEmpty(config.motionOutputEndpoint) == false) { predictionEventHandler?.OnStartPrediction(selected, config.profileReportEndpoint, config.motionOutputEndpoint); } } else { AXRServerPlugin.Disconnect(playerID); } }