public void DisablePanel(ErrorIndex index)
        {
            ErrorHandlingPanels[index].SetActive(false);

            if (PlayerHandUILaserPointer.LaserPointer.isActiveAndEnabled)
            {
                PlayerHandUILaserPointer.ResetColors();
                PlayerHandUILaserPointer.EnableLaserPointer(false);
            }
        }
        public void EnablePanel(ErrorIndex index, bool enableLaserPointer = false)
        {
            ErrorHandlingPanels[index].SetActive(true);

            if (enableLaserPointer)
            {
                PlayerHandUILaserPointer.SetColors(Color.red, Color.white);
                PlayerHandUILaserPointer.EnableLaserPointer(enableLaserPointer);
            }
        }
Example #3
0
        public override void ActionToDo()
        {
            if (isOn)
            {
                ViveSR_Experience_ControllerDelegate.touchpadDelegate += HandleTouchpad_ResetDepthPanel;
                ViveSR_Experience_ControllerDelegate.triggerDelegate  += HandleTrigger_AdjustSliders;
            }
            else
            {
                ViveSR_Experience_ControllerDelegate.touchpadDelegate -= HandleTouchpad_ResetDepthPanel;
                ViveSR_Experience_ControllerDelegate.triggerDelegate  -= HandleTrigger_AdjustSliders;
            }

            DepthControlScript.gameObject.SetActive(isOn);
            PlayerHandUILaserPointer.EnableLaserPointer(isOn);
        }
        public void Init()
        {
            ViveSR_Experience_HintMessage.instance.Init();

            PlayerHandUILaserPointer.CreateLaserPointer();
            PlayerHandUILaserPointer.EnableLaserPointer(false);

            Rotator           = FindObjectOfType <ViveSR_Experience_Rotator>();
            Tutorial          = FindObjectOfType <ViveSR_Experience_Tutorial>();
            StaticMeshScript  = FindObjectOfType <ViveSR_Experience_StaticMesh>();
            CalibrationScript = FindObjectOfType <ViveSR_Experience_Calibration>();
            PortalScript      = FindObjectOfType <ViveSR_Experience_Portal>();

            ButtonScripts[MenuButton.DepthControl]  = FindObjectOfType <ViveSR_Experience_Button_DepthControl>();
            ButtonScripts[MenuButton._3DPreview]    = FindObjectOfType <ViveSR_Experience_Button_3DPreview>();
            ButtonScripts[MenuButton.EnableMesh]    = FindObjectOfType <ViveSR_Experience_Button_EnableMesh>();
            ButtonScripts[MenuButton.Segmentation]  = FindObjectOfType <ViveSR_Experience_Button_Segmentation>();
            ButtonScripts[MenuButton.Portal]        = FindObjectOfType <ViveSR_Experience_Button_Portal>();
            ButtonScripts[MenuButton.Effects]       = FindObjectOfType <ViveSR_Experience_Button_Effects>();
            ButtonScripts[MenuButton.CameraControl] = FindObjectOfType <ViveSR_Experience_Button_CameraControl>();
            ButtonScripts[MenuButton.Calibration]   = FindObjectOfType <ViveSR_Experience_Button_Calibration>();

            SubButtonScripts[SubMenuButton._3DPreview_Save]       = FindObjectOfType <ViveSR_Experience_SubBtn_3DPreview_Save>();
            SubButtonScripts[SubMenuButton._3DPreview_Scan]       = FindObjectOfType <ViveSR_Experience_SubBtn_3DPreview_Scan>();
            SubButtonScripts[SubMenuButton.Calibration_Alignment] = FindObjectOfType <ViveSR_Experience_SubBtn_Calibration_Alignment>();
            SubButtonScripts[SubMenuButton.Calibration_Focus]     = FindObjectOfType <ViveSR_Experience_SubBtn_Calibration_Focus>();
            SubButtonScripts[SubMenuButton.Calibration_Reset]     = FindObjectOfType <ViveSR_Experience_SubBtn_Calibration_Reset>();
            SubButtonScripts[SubMenuButton.EnableMesh_StaticMR]   = FindObjectOfType <ViveSR_Experience_SubBtn_EnableMesh_StaticMR>();
            SubButtonScripts[SubMenuButton.EnableMesh_StaticVR]   = FindObjectOfType <ViveSR_Experience_SubBtn_EnableMesh_StaticVR>();
            SubButtonScripts[SubMenuButton.EnableMesh_Dynamic]    = FindObjectOfType <ViveSR_Experience_SubBtn_EnableMesh_Dynamic>();

            for (int i = 0; i < (int)DartGeneratorIndex.MaxNum; i++)
            {
                DartGeneratorMgrs[(DartGeneratorIndex)i] = _DartGeneratorMgrs[i];
            }

            for (int i = 0; i < (int)MenuButton.MaxNum; i++)
            {
                MenuButton MenuButton = (MenuButton)i;
                ButtonRenderers[MenuButton] = ButtonScripts[MenuButton].GetComponentInChildren <Renderer>();
            }

            ViveSR_Experience.instance.AttachPoint.SetActive(true);
            PortalScript.Init();
            Rotator.Init();


            for (int i = 0; i < Rotator.IncludedBtns.Count; ++i)
            {
                Rotator.IncludedBtns[i].Init_Awake();
                Rotator.IncludedBtns[i].Init_Start();

                if (Rotator.IncludedBtns[i].SubMenu == null)
                {
                    continue;
                }
                for (int j = 0; j < Rotator.IncludedBtns[i].SubMenu.subBtnScripts.Count; ++j)
                {
                    Rotator.IncludedBtns[i].SubMenu.subBtnScripts[j].Init_Awake();
                    Rotator.IncludedBtns[i].SubMenu.subBtnScripts[j].Init_Start();
                }
            }

            Tutorial.Init();
        }