3

我经常收到在 Viveport 上玩我的游戏的用户报告他们的控制器不工作。我相信这是由于缺少控制器绑定。当我在 Viveport 上测试游戏时,它对我来说效果很好。

已为每个控制器导出默认绑定。控制器在 Steam 上运行良好(直接使用 SteamVR),但在 Viveport 上却不行。出于某种原因,Viveport 使用的 SteamVR 看不到默认绑定。

绑定由 Unity 自动生成:Windows / SteamVR Input / Save and Generate。绑定文件位于:\StreamingAssets\SteamVR

统一 2020.1.2f1

SteamVR 测试版 1.15.2

如何使绑定在 Viveport SteamVR 上工作?

应该如何正确导出和保存默认绑定?

动作文件:actions.json

{
  "actions": [
    {
      "name": "/actions/default/in/InteractUI",
      "type": "boolean",
      "requirement": "suggested"
    },
    {
      "name": "/actions/default/in/Teleport",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/GrabPinch",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/GrabGrip",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/Pose",
      "type": "pose"
    },
    {
      "name": "/actions/default/in/SkeletonLeftHand",
      "type": "skeleton",
      "skeleton": "/skeleton/hand/left"
    },
    {
      "name": "/actions/default/in/SkeletonRightHand",
      "type": "skeleton",
      "skeleton": "/skeleton/hand/right"
    },
    {
      "name": "/actions/default/in/Squeeze",
      "type": "vector1",
      "requirement": "optional"
    },
    {
      "name": "/actions/default/in/HeadsetOnHead",
      "type": "boolean",
      "requirement": "optional"
    },
    {
      "name": "/actions/default/in/SnapTurnLeft",
      "type": "boolean",
      "requirement": "suggested"
    },
    {
      "name": "/actions/default/in/SnapTurnRight",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/SaberOnOff",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/ForceUse",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/Movement",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/VIVE Tutorial",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/Index Tutorial",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/Oculus_Tutorial",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/DirectionalMovement",
      "type": "vector2"
    },
    {
      "name": "/actions/default/in/MENU",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/WMR_Tutorial",
      "type": "boolean"
    },
    {
      "name": "/actions/default/in/VIVE_Cosmos",
      "type": "boolean"
    },
    {
      "name": "/actions/default/out/Haptic",
      "type": "vibration"
    },
    {
      "name": "/actions/platformer/in/Move",
      "type": "vector2"
    },
    {
      "name": "/actions/platformer/in/Jump",
      "type": "boolean"
    },
    {
      "name": "/actions/buggy/in/Steering",
      "type": "vector2"
    },
    {
      "name": "/actions/buggy/in/Throttle",
      "type": "vector1"
    },
    {
      "name": "/actions/buggy/in/Brake",
      "type": "boolean"
    },
    {
      "name": "/actions/buggy/in/Reset",
      "type": "boolean"
    },
    {
      "name": "/actions/mixedreality/in/ExternalCamera",
      "type": "pose",
      "requirement": "optional"
    }
  ],
  "action_sets": [
    {
      "name": "/actions/default",
      "usage": "single"
    },
    {
      "name": "/actions/platformer",
      "usage": "single"
    },
    {
      "name": "/actions/buggy",
      "usage": "single"
    },
    {
      "name": "/actions/mixedreality",
      "usage": "single"
    }
  ],
  "default_bindings": [
    {
      "controller_type": "vive_controller",
      "binding_url": "bindings_vive_controller.json"
    },
    {
      "controller_type": "oculus_touch",
      "binding_url": "bindings_oculus_touch.json"
    },
    {
      "controller_type": "knuckles",
      "binding_url": "bindings_knuckles.json"
    },
    {
      "controller_type": "holographic_controller",
      "binding_url": "bindings_holographic_controller.json"
    },
    {
      "controller_type": "vive_cosmos_controller",
      "binding_url": "bindings_vive_cosmos_controller.json"
    },
    {
      "controller_type": "vive_cosmos",
      "binding_url": "binding_vive_cosmos.json"
    },
    {
      "controller_type": "vive",
      "binding_url": "binding_vive.json"
    },
    {
      "controller_type": "indexhmd",
      "binding_url": "binding_index_hmd.json"
    },
    {
      "controller_type": "vive_pro",
      "binding_url": "binding_vive_pro.json"
    },
    {
      "controller_type": "rift",
      "binding_url": "binding_rift.json"
    },
    {
      "controller_type": "holographic_hmd",
      "binding_url": "binding_holographic_hmd.json"
    },
    {
      "controller_type": "vive_tracker_camera",
      "binding_url": "binding_vive_tracker_camera.json"
    }
  ],
  "localization": [
    {
      "language_tag": "en_US",
      "/actions/default/in/GrabGrip": "Grab Grip",
      "/actions/default/in/GrabPinch": "Grab Pinch",
      "/actions/default/in/HeadsetOnHead": "Headset on head (proximity sensor)",
      "/actions/default/in/InteractUI": "Interact With UI",
      "/actions/default/in/Pose": "Pose",
      "/actions/default/in/SkeletonLeftHand": "Skeleton (Left)",
      "/actions/default/in/SkeletonRightHand": "Skeleton (Right)",
      "/actions/default/in/Teleport": "Teleport",
      "/actions/default/out/Haptic": "Haptic",
      "/actions/platformer/in/Jump": "Jump",
      "/actions/default/in/SnapTurnLeft": "Snap Turn (Left)",
      "/actions/default/in/SnapTurnRight": "Snap Turn (Right)",
      "/actions/default/in/SaberOnOff": "Saber On/Off",
      "/actions/default/in/ForceUse": "Force Use",
      "/actions/default/in/Movement": "Movement (Grab)",
      "/actions/default/in/VIVE Tutorial": "VIVE Tutorial",
      "/actions/default/in/Index Tutorial": "Index Tutorial",
      "/actions/default/in/Oculus_Tutorial": "Oculus Tutorial",
      "/actions/default/in/DirectionalMovement": "Movement (Directional)",
      "/actions/default/in/MENU": "MENU",
      "/actions/default/in/WMR_Tutorial": "Windows Mixed Reality Tutorial",
      "/actions/default/in/VIVE_Cosmos": "Vive Cosmos Identification"
    }
  ]
}

示例绑定文件:bindings_knuckles.json

{
   "action_manifest_version" : 0,
   "alias_info" : {},
   "app_key" : "application.generated.unity.saberfightvr.exe",
   "bindings" : {
      "/actions/buggy" : {
         "sources" : [
            {
               "inputs" : {
                  "position" : {
                     "output" : "/actions/buggy/in/steering"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/left/input/thumbstick"
            },
            {
               "inputs" : {
                  "position" : {
                     "output" : "/actions/buggy/in/steering"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/right/input/thumbstick"
            },
            {
               "inputs" : {
                  "pull" : {
                     "output" : "/actions/buggy/in/throttle"
                  }
               },
               "mode" : "trigger",
               "path" : "/user/hand/left/input/trigger"
            },
            {
               "inputs" : {
                  "pull" : {
                     "output" : "/actions/buggy/in/throttle"
                  }
               },
               "mode" : "trigger",
               "path" : "/user/hand/right/input/trigger"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/buggy/in/brake"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/a"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/buggy/in/brake"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/a"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/buggy/in/reset"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/b"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/buggy/in/reset"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/b"
            }
         ]
      },
      "/actions/default" : {
         "chords" : [],
         "haptics" : [
            {
               "output" : "/actions/default/out/haptic",
               "path" : "/user/hand/left/output/haptic"
            },
            {
               "output" : "/actions/default/out/haptic",
               "path" : "/user/hand/right/output/haptic"
            }
         ],
         "poses" : [
            {
               "output" : "/actions/default/in/pose",
               "path" : "/user/hand/left/pose/raw"
            },
            {
               "output" : "/actions/default/in/pose",
               "path" : "/user/hand/right/pose/raw"
            }
         ],
         "skeleton" : [
            {
               "output" : "/actions/default/in/skeletonlefthand",
               "path" : "/user/hand/left/input/skeleton/left"
            },
            {
               "output" : "/actions/default/in/skeletonrighthand",
               "path" : "/user/hand/right/input/skeleton/right"
            }
         ],
         "sources" : [
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/interactui"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/trigger"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/movement"
                  },
                  "position" : {
                     "output" : "/actions/default/in/directionalmovement"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/left/input/thumbstick"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/grabpinch"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/grip"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/saberonoff"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/a"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/index tutorial"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/trigger"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/menu"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/b"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/forceuse"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/trackpad"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/saberonoff"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/a"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/menu"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/b"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/grabpinch"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/grip"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/movement"
                  },
                  "position" : {
                     "output" : "/actions/default/in/directionalmovement"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/right/input/thumbstick"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/forceuse"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/trackpad"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/interactui"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/trigger"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/default/in/index tutorial"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/trigger"
            },
            {
               "inputs" : {
                  "east" : {
                     "output" : "/actions/default/in/snapturnright"
                  },
                  "west" : {
                     "output" : "/actions/default/in/snapturnleft"
                  }
               },
               "mode" : "dpad",
               "parameters" : {
                  "sub_mode" : "touch"
               },
               "path" : "/user/hand/left/input/thumbstick"
            },
            {
               "inputs" : {
                  "east" : {
                     "output" : "/actions/default/in/snapturnright"
                  },
                  "west" : {
                     "output" : "/actions/default/in/snapturnleft"
                  }
               },
               "mode" : "dpad",
               "parameters" : {
                  "sub_mode" : "touch"
               },
               "path" : "/user/hand/right/input/thumbstick"
            }
         ]
      },
      "/actions/platformer" : {
         "sources" : [
            {
               "inputs" : {
                  "position" : {
                     "output" : "/actions/platformer/in/move"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/left/input/thumbstick"
            },
            {
               "inputs" : {
                  "position" : {
                     "output" : "/actions/platformer/in/move"
                  }
               },
               "mode" : "joystick",
               "path" : "/user/hand/right/input/thumbstick"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/platformer/in/jump"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/left/input/trigger"
            },
            {
               "inputs" : {
                  "click" : {
                     "output" : "/actions/platformer/in/jump"
                  }
               },
               "mode" : "button",
               "path" : "/user/hand/right/input/trigger"
            }
         ]
      }
   },
   "category" : "steamvr_input",
   "controller_type" : "knuckles",
   "description" : "",
   "name" : "Saber Fight VR for Index Controller",
   "options" : {},
   "simulated_actions" : []
}

4

0 回答 0