Ejemplo n.º 1
0
    public Vector2 AnalogValu(ViveDeviceType hand, ViveAnalog code)
    {
        ViveUpdate();
        switch (hand)
        {
        case ViveDeviceType.LeftHand:
        {
            if (code == ViveAnalog.Touchpad)
            {
                return(m_LeftTouchpad);
            }
            if (code == ViveAnalog.Trigger)
            {
                return(m_LeftTrigger);
            }
        }
        break;

        case ViveDeviceType.RightHand:
        {
            if (code == ViveAnalog.Touchpad)
            {
                return(m_RightTouchpad);
            }
            if (code == ViveAnalog.Trigger)
            {
                return(m_RightTrigger);
            }
        }
        break;
        }

        Debug.Log("何か入力機能がうまくいってないよ");
        return(Vector2.zero);
    }
Ejemplo n.º 2
0
    public SteamVR_Controller.Device GetDevice(ViveDeviceType ctrlType)
    {
        switch (ctrlType)
        {
        case ViveDeviceType.RightHand:
            return(rightDevice);

        case ViveDeviceType.LeftHand:
            return(leftDevice);
        }
        return(null);
    }
Ejemplo n.º 3
0
    public SteamVR_Controller.Device UseController(ViveDeviceType _side)
    {
        manager = originObj.GetComponent <SteamVR_ControllerManager>();

        if (_side == ViveDeviceType.RightHand)
        {
            return(SteamVR_Controller.Input((int)manager.right.GetComponent <SteamVR_TrackedObject>().index));
        }
        if (_side == ViveDeviceType.LeftHand)
        {
            return(SteamVR_Controller.Input((int)manager.left.GetComponent <SteamVR_TrackedObject>().index));
        }
        return(null);
    }
Ejemplo n.º 4
0
    public bool Trigger(ViveDeviceType hand, ViveKey code)
    {
        ViveUpdate();
        switch (hand)
        {
        case ViveDeviceType.RightHand:
            return(m_RightDown[(int)code]);

        case ViveDeviceType.LeftHand:
            return(m_LeftDown[(int)code]);
        }

        Debug.Log("何か入力機能がうまくいってないよ");
        return(false);
    }