SteamVR_Controller.Device.GetPress C# (CSharp) Méthode

GetPress() public méthode

public GetPress ( EVRButtonId buttonId ) : bool
buttonId EVRButtonId
Résultat bool
        public bool GetPress(EVRButtonId buttonId)
        {
            return GetPress(1ul << (int)buttonId);
        }

Same methods

SteamVR_Controller.Device::GetPress ( ulong buttonMask ) : bool

Usage Example

    void FixedUpdate()
    {
        device = SteamVR_Controller.Input ((int)trackedObj.index);

        if (device.GetTouch (SteamVR_Controller.ButtonMask.Trigger)) {
            Debug.Log ("You are holding 'touch' on the trigger");
        }
        if (device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger))
        {
            Debug.Log("You activated TouchDown on the trigger");
        }
        if (device.GetTouchUp(SteamVR_Controller.ButtonMask.Trigger))
        {
            Debug.Log("You activated TouchUp on the trigger");
        }

        if (device.GetPress(SteamVR_Controller.ButtonMask.Trigger))
        {
            Debug.Log("You are holding 'press' on the trigger");
        }
        if (device.GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
        {
            Debug.Log("You activated PressDown on the trigger");
        }
        if (device.GetPressUp(SteamVR_Controller.ButtonMask.Touchpad))
        {
            Debug.Log("You activated PressUp on the touchpad");
            sphere.transform.position = Vector3.zero;
            sphere.GetComponent<Rigidbody>().velocity = Vector3.zero;
            sphere.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
        }
    }
All Usage Examples Of SteamVR_Controller.Device::GetPress