コード例 #1
0
    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;
    }
コード例 #2
0
 public void Disconnect()
 {
     if (isBoundToClient)
     {
         AXRServerPlugin.Disconnect(playerID);
     }
 }
コード例 #3
0
    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);
        }
    }