예제 #1
0
        public Streams(int playerID, AirXRServerMediaStream mediaStream, AirXRServerInputStream inputStream)
        {
            Assert.IsNotNull(inputStream.owner);

            this.playerID    = playerID;
            this.mediaStream = mediaStream;
            this.inputStream = inputStream;
        }
예제 #2
0
    private void Awake()
    {
        ensureGameObjectIntegrity(false);
        if (Application.isPlaying == false)
        {
            return;
        }

        AirXRServer.LoadOnce();

        disableCameras();
        AirXRCameraRigManager.managerOnCurrentScene.RegisterCameraRig(this);
        AirXRCameraRigManager.managerOnCurrentScene.eventDispatcher.MessageReceived += onAirXRMessageReceived;

        playerID = AXRServerPlugin.InvalidPlayerID;

        inputStream = new AirXRServerInputStream(this);

        if (_sendAudio)
        {
            _audioOutputRouter                  = headAnchor.gameObject.AddComponent <AirXRServerAudioOutputRouter>();
            _audioOutputRouter.input            = _audioInput;
            _audioOutputRouter.targetAudioMixer = _targetAudioMixer;
            _audioOutputRouter.exposedRendererIDParameterName = _exposedRendererIDParameterName;
            _audioOutputRouter.targetCameraRig = this;

            if (_audioInput == AirXRServerAudioOutputRouter.Input.AudioListener)
            {
                _audioOutputRouter.output = AirXRServerAudioOutputRouter.Output.All;

                _audioListener = headAnchor.gameObject.AddComponent <AudioListener>();
            }
            else
            {
                _audioOutputRouter.output = AirXRServerAudioOutputRouter.Output.One;
            }
        }

        if (_audioOutputRouter)
        {
            _audioOutputRouter.enabled = false;
        }
        //if (_audioListener) {
        //    _audioListener.enabled = false;
        //}

        _predictiveCameraRig = GetComponent <AirXRPredictiveCameraRig>();
        _cameraEventEmitter  = cameras[0].gameObject.AddComponent <CameraEventEmitter>();

        onAwake();
    }
예제 #3
0
    internal void BindPlayer(int playerID, AirXRServerMediaStream mediaStream, AirXRServerInputStream inputStream)
    {
        BindPlayer(playerID);

        this.mediaStream       = mediaStream;
        this.inputStream       = inputStream;
        this.inputStream.owner = this;

        initializeCamerasForMediaStream();
        if (isStreaming)
        {
            startToRenderCamerasForMediaStream();
        }
    }