void RunAutoOrManual()
    {
        if (manualConfigKeyEntered == "A")
        {
            ChangeState(ConfigState.AUTO);
        }
        else if (manualConfigKeyEntered == "M")
        {
            // immediately use the selecte dmount type for manual setup
            var  setup            = PhysicalConfigurable.Config;
            bool wasBottomMounted = Mathf.Approximately(0, setup.LeapRotationD.z);

            if (wasBottomMounted && selectedMountType == MountingType.OVERHEAD)
            {
                setup.LeapRotationD = new Vector3(-setup.LeapRotationD.x, setup.LeapRotationD.y, 180f);
                PhysicalConfigurable.UpdateConfig(setup);
            }
            else if (!wasBottomMounted && selectedMountType == MountingType.BOTTOM)
            {
                setup.LeapRotationD = new Vector3(-setup.LeapRotationD.x, setup.LeapRotationD.y, 0f);
                PhysicalConfigurable.UpdateConfig(setup);
            }

            // dont alloe manual to flip the axes again
            selectedMountType = MountingType.NONE;
            ChangeState(ConfigState.MANUAL);
        }
    }
    void RunLeapMount()
    {
        if (manualConfigKeyEntered == "SCREENTOP")
        {
            // To help with Auto and manual, we set the tracking mode here. This way the user is in the correct mode for running a Setup
            selectedMountType = MountingType.SCREENTOP;
            SingleHandManager.Instance.SetLeapTrackingMode(selectedMountType);
            ChangeState(ConfigState.AUTO_OR_MANUAL);
        }
        else if (manualConfigKeyEntered == "BOTTOM")
        {
            // To help with Auto and manual, we set the tracking mode here. This way the user is in the correct mode for running a Setup
            selectedMountType = MountingType.DESKTOP;
            SingleHandManager.Instance.SetLeapTrackingMode(selectedMountType);
            ChangeState(ConfigState.AUTO_OR_MANUAL);
        }
        else if (manualConfigKeyEntered == "OVERHEAD")
        {
            // To help with Auto and manual, we set the tracking mode here. This way the user is in the correct mode for running a Setup
            selectedMountType = MountingType.OVERHEAD;
            SingleHandManager.Instance.SetLeapTrackingMode(selectedMountType);
            ChangeState(ConfigState.AUTO_OR_MANUAL);
        }

        if (manualConfigKeyEntered == "SETUPGUIDE")
        {
            Application.OpenURL("http://rebrand.ly/ul-camera-setup");
        }
    }
 void RunAutoConfigComplete()
 {
     if (manualConfigKeyEntered == "M")
     {
         selectedMountType = MountingType.NONE;
         ChangeState(ConfigState.MANUAL);
     }
     else if (manualConfigKeyEntered == "A")
     {
         ChangeState(ConfigState.AUTO);
     }
     else if (manualConfigKeyEntered == "T")
     {
         ChangeState(ConfigState.TEST_CALIBRATION);
     }
 }
    void RunLeapMount()
    {
        if (manualConfigKeyEntered == "T")
        {
            selectedMountType = MountingType.OVERHEAD;
            ChangeState(ConfigState.AUTO_OR_MANUAL);
        }
        else if (manualConfigKeyEntered == "B")
        {
            selectedMountType = MountingType.BOTTOM;
            ChangeState(ConfigState.AUTO_OR_MANUAL);
        }

        if (manualConfigKeyEntered == "SETUPGUIDE")
        {
            Application.OpenURL("http://rebrand.ly/ul-camera-setup");
            //closeConfig = true;
        }
    }
    public void SetLeapTrackingMode(MountingType _mount)
    {
        switch (_mount)
        {
        case MountingType.NONE:
        case MountingType.DESKTOP:
            ((LeapServiceProvider)Hands.Provider).GetLeapController().ClearPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_HMD);
            ((LeapServiceProvider)Hands.Provider).GetLeapController().ClearPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_SCREENTOP);
            break;

        case MountingType.SCREENTOP:
            ((LeapServiceProvider)Hands.Provider).GetLeapController().SetPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_SCREENTOP);
            ((LeapServiceProvider)Hands.Provider).GetLeapController().ClearPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_HMD);
            break;

        case MountingType.OVERHEAD:
            ((LeapServiceProvider)Hands.Provider).GetLeapController().SetPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_HMD);
            ((LeapServiceProvider)Hands.Provider).GetLeapController().ClearPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_SCREENTOP);
            break;
        }
    }