private void Update()
        {
            if (Input.GetKeyDown(KeyCode.V))
            {
                //启动投屏窗口
                FARStartRenderingView(WorkMode._DoubleTexture);
            }
            if (Input.GetKeyDown(KeyCode.Q))
            {
                //关闭投屏窗口
                FARDll.CloseDown();
            }
            if (_lastWorkingType != workingMode)
            {
                //切换到2D画面
                FARStartRenderingView(workingMode);
                _lastWorkingType = workingMode;
            }

            ///切换投影方式
            if (Input.GetKeyDown(KeyCode.K))
            {
                FARDll.SwitchProjector(FARDll.ProjectorType._2D);
            }
            if (Input.GetKeyDown(KeyCode.J))
            {
                FARDll.SwitchProjector(FARDll.ProjectorType.LeftRight);
            }
        }
Example #2
0
        private void OnGUI()
        {
            if (SceneManager.GetActiveScene().name == "VRSample" || SceneManager.GetActiveScene().name == "All")
            {
                if (GUI.Button(new Rect(20, 20, 160, 60), "2D"))
                {
                    FARStartRenderingView(WorkMode._DoubleTexture);
                    FARDll.SwitchProjector(FARDll.ProjectorType._2D);
                }

                if (GUI.Button(new Rect(200, 20, 160, 60), "3D"))
                {
                    FARStartRenderingView(WorkMode._DoubleTexture);
                    FARDll.SwitchProjector(FARDll.ProjectorType.LeftRight);
                }
            }

            if (SceneManager.GetActiveScene().name == "F-ARSample" || SceneManager.GetActiveScene().name == "All")
            {
                if (GUI.Button(new Rect(20, 100, 160, 60), "AR"))
                {
                    FARStartRenderingView(WorkMode._SingleTexture);
                    //FARDll.SwitchProjector(FARDll.ProjectorType.LeftRight);
                }
            }

            if (SceneManager.GetActiveScene().name == "UIInter_Switch23D")
            {
                return;
            }
            if (GUI.Button(new Rect(200, 100, 160, 60), "关闭"))
            {
                FARDll.CloseDown();
            }
        }