Ejemplo n.º 1
0
    /// <summary>
    /// 檢查圓盤四邊的狀態
    /// 需要找個物件掛上 SteamVR_ActivateActionSetOnLoad.cs 激活 platformer動作集
    /// </summary>
    private void Check_PadPos()
    {
        //上
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.PadUp))
        {
            Debug.LogWarning("按下圓盤-上");
        }
        if (VRInput.GetPress(inputSource, EM_ControllerButton.PadUp))
        {
            Debug.LogWarning("按住圓盤-上");
        }
        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.PadUp))
        {
            Debug.LogWarning("放開圓盤-上");
        }

        //下
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.PadDown))
        {
            Debug.LogWarning("按下圓盤-下");
        }
        if (VRInput.GetPress(inputSource, EM_ControllerButton.PadDown))
        {
            Debug.LogWarning("按住圓盤-下");
        }
        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.PadDown))
        {
            Debug.LogWarning("放開圓盤-下");
        }


        //左
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.PadLeft))
        {
            Debug.LogWarning("按下圓盤-左");
        }
        if (VRInput.GetPress(inputSource, EM_ControllerButton.PadLeft))
        {
            Debug.LogWarning("按住圓盤-左");
        }
        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.PadLeft))
        {
            Debug.LogWarning("放開圓盤-左");
        }

        //右
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.PadRight))
        {
            Debug.LogWarning("按下圓盤-右");
        }
        if (VRInput.GetPress(inputSource, EM_ControllerButton.PadRight))
        {
            Debug.LogWarning("按住圓盤-右");
        }
        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.PadRight))
        {
            Debug.LogWarning("放開圓盤-右");
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 檢查握柄狀態
    /// </summary>
    private void Check_Grip()
    {
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.Grip))
        {
            Debug.LogWarning("按下握柄");
        }

        if (VRInput.GetPress(inputSource, EM_ControllerButton.Grip))
        {
            Debug.LogWarning("按住握柄");
        }

        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.Grip))
        {
            Debug.LogWarning("放開握柄");
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 檢查圓盤狀態
    /// </summary>
    private void Check_Pad()
    {
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.Pad))
        {
            Debug.LogWarning("按下圓盤");
        }

        if (VRInput.GetPress(inputSource, EM_ControllerButton.Pad))
        {
            Debug.LogWarning("按住圓盤");
        }

        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.Pad))
        {
            Debug.LogWarning("放開圓盤");
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 檢查板機狀態
    /// </summary>
    private void Check_Trigger()
    {
        if (VRInput.GetPressDown(inputSource, EM_ControllerButton.Trigger))
        {
            Debug.LogWarning("按下板機");
        }

        if (VRInput.GetPress(inputSource, EM_ControllerButton.Trigger))
        {
            Debug.LogWarning("按住板機");
        }

        if (VRInput.GetPressUp(inputSource, EM_ControllerButton.Trigger))
        {
            Debug.LogWarning("放開板機");
        }
    }
Ejemplo n.º 5
0
 public bool GetTriggerUp()
 {
     if (VRGloveInput != null && VRGloveInput.InputValid)
     {
         InteractingMethod currentMethod = currentHoveringObject == null ? InteractingMethod.Click : currentHoveringObject.interactingMethod;
         if (currentMethod == InteractingMethod.Click)
         {
             return(VRGloveInput.GetGestureExit(VRTRIX.VRTRIXGloveGesture.BUTTONCLICK));
         }
         else
         {
             return(VRGloveInput.GetGestureExit(VRTRIX.VRTRIXGloveGesture.BUTTONGRAB));
         }
     }
     else if (VRInput != null)
     {
         return(VRInput.GetPressUp(EVRButtonId.k_EButton_SteamVR_Trigger));
     }
     else
     {
         return(Input.GetMouseButtonUp(0));
     }
 }