示例#1
0
    private void Update()
    {
        if (leftHandDevice == default)
        {
            leftHandDevice = GetHand(InputDeviceCharacteristics.Left);
            if (leftHandDevice != default)
            {
                leftHand = new VRControllerInputValues(leftHandDevice);
                hands.Add(HorizontalSide.left, leftHand);
            }
        }
        else
        {
            leftHand.Update();
        }

        if (rightHandDevice == default)
        {
            rightHandDevice = GetHand(InputDeviceCharacteristics.Right);
            if (rightHandDevice != default)
            {
                rightHand = new VRControllerInputValues(rightHandDevice);
                hands.Add(HorizontalSide.right, rightHand);
            }
        }
        else
        {
            rightHand.Update();
        }
    }
示例#2
0
    protected override void SingletonAwake()
    {
        leftHandDevice = GetHand(InputDeviceCharacteristics.Left);
        if (leftHandDevice != default)
        {
            leftHand = new VRControllerInputValues(leftHandDevice);
            hands.Add(HorizontalSide.left, leftHand);
        }

        rightHandDevice = GetHand(InputDeviceCharacteristics.Right);
        if (rightHandDevice != default)
        {
            rightHand = new VRControllerInputValues(rightHandDevice);
            hands.Add(HorizontalSide.right, rightHand);
        }
    }