示例#1
0
    void UpdateInput()
    {
        vrDeviceManager dmgr = MiddleVR.VRDeviceMgr;

        if (dmgr != null)
        {
            vrButtons wandButtons = dmgr.GetWandButtons();

            if (wandButtons != null)
            {
                uint buttonNb = wandButtons.GetButtonsNb();
                if (buttonNb > 0)
                {
                    WandButton0 = wandButtons.IsPressed(dmgr.GetWandButton0());
                }
                if (buttonNb > 1)
                {
                    WandButton1 = wandButtons.IsPressed(dmgr.GetWandButton1());
                }
                if (buttonNb > 2)
                {
                    WandButton2 = wandButtons.IsPressed(dmgr.GetWandButton2());
                }
                if (buttonNb > 3)
                {
                    WandButton3 = wandButtons.IsPressed(dmgr.GetWandButton3());
                }
                if (buttonNb > 4)
                {
                    WandButton4 = wandButtons.IsPressed(dmgr.GetWandButton4());
                }
                if (buttonNb > 5)
                {
                    WandButton5 = wandButtons.IsPressed(dmgr.GetWandButton5());
                }
            }

            WandAxisHorizontal = dmgr.GetWandHorizontalAxisValue();
            WandAxisVertical   = dmgr.GetWandVerticalAxisValue();
        }
    }
示例#2
0
    private void UpdateInput()
    {
        vrButtons wandButtons = m_DeviceMgr.GetWandButtons();

        if (wandButtons != null)
        {
            uint buttonNb = wandButtons.GetButtonsNb();
            if (buttonNb > 0)
            {
                WandButton0 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton0());
            }
            if (buttonNb > 1)
            {
                WandButton1 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton1());
            }
            if (buttonNb > 2)
            {
                WandButton2 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton2());
            }
            if (buttonNb > 3)
            {
                WandButton3 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton3());
            }
            if (buttonNb > 4)
            {
                WandButton4 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton4());
            }
            if (buttonNb > 5)
            {
                WandButton5 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton5());
            }
        }

        WandAxisHorizontal = m_DeviceMgr.GetWandHorizontalAxisValue();
        WandAxisVertical   = m_DeviceMgr.GetWandVerticalAxisValue();
    }