• 1 :获取手柄编号

                                                           // 手柄组件 Left = GetComponent<SteamVR_TrackedObject>();

                                                            // 获取手柄编号(左手柄 == 2) Debug.Log((int)Left.index);

 

                                                                                                                                            在手柄上挂载此脚本

                                                                                                 

                                                               2 : 获取扳机按键

                                      // 按下了扳机按钮调用
                            if (device.GetTouch(SteamVR_Controller.ButtonMask.Trigger))
                            {
                                      Debug.Log("trigger");
                             }

                                     第二种方式也是Ok的
                             if (device.GetPressDown(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger))
                              {
                                    print("123");
                              }

                                                                                

2 : 获取扳机按键

                                                 

 

posted on 2017-03-31 21:42  觅Joanna  阅读(268)  评论(0)    收藏  举报