public void Run()
        {
            ISignaling mock = new MockSignaling();

            component.runOnAwake = false;
            component.gameObject.SetActive(true);
            component.Run(signaling: mock);
        }
示例#2
0
        public void Run()
        {
            var        handler  = component.gameObject.AddComponent <SingleConnection>();
            var        handlers = new SignalingHandlerBase[] { handler };
            ISignaling mock     = new MockSignaling();

            component.runOnAwake = false;
            component.gameObject.SetActive(true);
            component.Run(signaling: mock, handlers: handlers);
        }
        IEnumerator Start()
        {
            if (!renderStreaming.runOnAwake)
            {
                renderStreaming.Run(
                    hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
                    signaling: RenderStreamingSettings.Signaling);
            }

            if ((ARSession.state == ARSessionState.None) ||
                (ARSession.state == ARSessionState.CheckingAvailability))
            {
                yield return(ARSession.CheckAvailability());
            }

            if (ARSession.state == ARSessionState.Unsupported)
            {
                // Start some fallback experience for unsupported devices
                Debug.LogError("AR foundation is not supported on this device.");
            }
            else
            {
                // Start the AR session
                session.enabled = true;
            }
        }
 // Start is called before the first frame update
 void Start()
 {
     if (!renderStreaming.runOnAwake)
     {
         renderStreaming.Run(
             hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
             signaling: RenderStreamingSettings.Signaling);
     }
 }
示例#5
0
        // Start is called before the first frame update
        void Start()
        {
            dropdownCamera.onValueChanged.AddListener(OnChangeCamera);

            if (!renderStreaming.runOnAwake)
            {
                renderStreaming.Run(
                    hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
                    signaling: RenderStreamingSettings.Signaling);
            }
        }
示例#6
0
 void Start()
 {
     if (renderStreaming.runOnAwake)
     {
         return;
     }
     renderStreaming.Run(
         hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
         signaling: RenderStreamingSettings.Signaling);
     inputSender = GetComponent <InputSender>();
     inputSender.OnStartedChannel += OnStartedChannel;
 }
        void SetUpHost(string username)
        {
            menuCamera.SetActive(false);

            var instance = GameObject.Instantiate(prefabHost);
            var handler  = instance.GetComponent <Multiplay>();

            // host player
            var hostPlayer       = GameObject.Instantiate(prefabPlayer);
            var playerController = hostPlayer.GetComponent <PlayerController>();

            playerController.SetLabel(username);
            var playerInput = hostPlayer.GetComponent <InputReceiver>();

            playerInput.PerformPairingWithAllLocalDevices();
            playerController.CheckPairedDevices();

            renderStreaming.Run(
                hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
                signaling: RenderStreamingSettings.Signaling,
                handlers: new SignalingHandlerBase[] { handler }
                );
        }