Example #1
0
        // Callback for the NavigationMode buttons.
        public void OnChangeNavigationMode(string buttonName)
        {
            UpdateRadioButtons(buttonName);

            Tooltips.HideAll(VRDevice.SecondaryController);

            if (options.currentNavigationMode != null)
            {
                options.currentNavigationMode.DeInit();
            }

            switch (buttonName)
            {
            case "BiManual": OnNavMode_BiManual(); break;

            case "Teleport": OnNavMode_Teleport(); break;

            case "Orbit": OnNavMode_Orbit(); break;

            case "Fps": OnNavMode_Fps(); break;

            case "Drone": OnNavMode_Drone(); break;

            case "Fly": OnNavMode_Fly(); break;

            default: Debug.LogError("Unknown navigation mode button name was passed."); break;
            }
            HandleCommonTooltipsVisibility();

            // TODO Scriptable: trouver qui accede a ca
            //GlobalState.currentNavigationMode = currentNavigationMode;
        }
Example #2
0
        public static void SetRightHanded(bool value)
        {
            if (null != Instance.secondaryControllerDisplay && Settings.rightHanded == value)
            {
                return;
            }

            Settings.rightHanded = value;

            GameObject leftHandleRightController = Instance.paletteController.Find("right_controller").gameObject;
            GameObject leftHandleLeftController  = Instance.paletteController.Find("left_controller").gameObject;

            GameObject rightHandleRightController = Instance.toolsController.Find("right_controller").gameObject;
            GameObject rightHandleLeftController  = Instance.toolsController.Find("left_controller").gameObject;

            leftHandleLeftController.SetActive(value);
            leftHandleRightController.SetActive(!value);
            rightHandleRightController.SetActive(value);
            rightHandleLeftController.SetActive(!value);

            // Update controller's displays
            Instance.primaryControllerDisplay        = GetPrimaryControllerTransform().Find("Canvas/Text").GetComponent <TextMeshProUGUI>();
            Instance.secondaryControllerDisplay      = GetSecondaryControllerTransform().Find("Canvas/Text").GetComponent <TextMeshProUGUI>();
            Instance.secondaryControllerDisplay.text = "";
            Instance.primaryControllerDisplay.text   = "";

            // Update tooltips
            Tooltips.HideAll(VRDevice.PrimaryController);
            Tooltips.HideAll(VRDevice.SecondaryController);
            ToolBase tool = ToolsManager.CurrentTool();

            if (null != tool)
            {
                tool.SetTooltips();
            }
            Instance.playerController.HandleCommonTooltipsVisibility();

            // Move Palette
            Transform palette = Instance.paletteController.Find("PaletteHandle");
            Vector3   currentPalettePosition = palette.localPosition;

            if (Settings.rightHanded)
            {
                palette.localPosition = new Vector3(-0.02f, currentPalettePosition.y, currentPalettePosition.z);
            }
            else
            {
                palette.localPosition = new Vector3(-0.2f, currentPalettePosition.y, currentPalettePosition.z);
            }
        }
Example #3
0
        public void SetRightHanded(bool value)
        {
            inverseRightController.controllerTransform.gameObject.SetActive(!value);
            inverseLeftController.controllerTransform.gameObject.SetActive(!value);
            rightController.controllerTransform.gameObject.SetActive(value);
            leftController.controllerTransform.gameObject.SetActive(value);

            Transform toolsController   = GlobalState.Instance.toolsController;
            Transform paletteController = GlobalState.Instance.paletteController;


            // Update controller's displays
            rightController.controllerDisplay.text        = "";
            inverseRightController.controllerDisplay.text = "";
            leftController.controllerDisplay.text         = "";
            inverseLeftController.controllerDisplay.text  = "";

            // Update tooltips
            Tooltips.HideAll(VRDevice.PrimaryController);
            Tooltips.HideAll(VRDevice.SecondaryController);
            ToolBase tool = ToolsManager.CurrentTool();

            if (null != tool)
            {
                tool.SetTooltips();
            }
            GlobalState.Instance.playerController.HandleCommonTooltipsVisibility();

            Transform palette = GlobalState.Instance.paletteController.Find("PaletteHandle");

            if (value)
            {
                SetHolders(leftController, rightController, toolsController, paletteController, palette);
            }
            else
            {
                SetHolders(inverseRightController, inverseLeftController, toolsController, paletteController, palette);
            }
        }