値の取得方法
UnityでwindowsMRのモーションコントローラーのボタンのイベント取得ができなかったので調べていたんですが、僕のわかるレベルでの簡単な資料がなかったのでメモしておきます。
以下のコードで取得できます。
//Gripのボタンの取得
Input.GetKey("joystick button 5")
使い方は、
void Update(){
//押し続けてる間イベントを取得
if(Input.GetKey("joystick button 5")){
Debug.Log("GripKey");
}
//押したイベントを取得
if(Input.GetKeyDown("joystick button 5")){
Debug.Log("GripKey");
}
//離したイベントを取得
if(Input.GetKeyUp("joystick button 5")){
Debug.Log("GripKey");
}
}
モーションコントローラーのボタンの対応表はこちら。
https://developer.microsoft.com/en-us/windows/mixed-reality/gestures_and_motion_controllers_in_unity
なんか無茶苦茶にはまったので。。。これだから僕のような初心者は…