Exemplo n.º 1
0
        private void StartGame()
        {
            if (rightHandIsOn)
            {
                SetRightHand();
            }
            else
            {
                SetLeftHand();
            }



            if (!GameManager.instance.IsOculusGo)
            {
                ViveInput.AddPress(HandRole.LeftHand, ControllerButton.Trigger, LeftTrigger);
                ViveInput.AddPress(HandRole.RightHand, ControllerButton.Trigger, RightTrigger);
            }
            else
            {
                goProperty                = ViveRoleProperty.New(DeviceRole.Device1);
                _pt.viveRole.roleValue    = goProperty.roleValue;
                goProperty.onRoleChanged += GoProperty_onRoleChanged;
            }
        }
Exemplo n.º 2
0
    void AddListener()
    {
        //监听右手 右键
        ViveInput.AddPress(HandRole.RightHand, ControllerButton.Pad, onRightRightPress);
        ViveInput.AddPressDown(HandRole.RightHand, ControllerButton.Pad, onRightRightPressDown);
        ViveInput.AddPressUp(HandRole.RightHand, ControllerButton.Pad, onRightRightPressUp);
        //监听右手 左键持续按下
        ViveInput.AddPress(HandRole.RightHand, ControllerButton.Trigger, OnRightLeftPress);
        ViveInput.AddPressDown(HandRole.RightHand, ControllerButton.Trigger, OnRightLeftPressDown);
        ViveInput.AddPressUp(HandRole.RightHand, ControllerButton.Trigger, OnRightLeftPressUp);

        ViveInput.AddPressDown(HandRole.RightHand, ControllerButton.Grip, OnLeftRest);
    }