ExtendRealityLtd / ExtendRealityLtd/Tilia.Input.UnityInputSystem

Duplicated PlayerInput.cs in prefabs disable input in builds for Windows Mixed Reality

未关闭
#54 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
3
派生
1
PR 合并指标
30 天内没有已合并 PR

描述

### Environment

* Code source: Tilia.Input.UnityInputSystem
* Code version: 2.4.3
* Platform version: Unity 2021.3.24
* 3rd party dependencies: Windows Mixed Reality Portal

### Steps to reproduce

In a simple scene, or in the tilia farm, add the `UnityInputSystem.Poses.GenericXR.prefab` into the scene. Optionally, have the pointers follow the prefab's `LeftPointer` and `RightPointer` instead of the `LeftControllerAlias` and `RightControllerAlias`. If not there already, add the `UnityInputSystem.InputActionMappings.GenericXR.prefab` and map actions to it.

### Expected behavior

After a build, and using WMR OpenXR, pointers follow the controller pointer pose, like in the editor.

### Current behavior

Controllers are tracked, but no controller input is received.

### Testing done

I tested multiple configurations and builds. It seems that if multiple instances of `PlayerInput.cs` are enabled, the Windows Mixed Reality OpenXR runtime stops processing input. This happens only on builds, and only for WMR. Disabling all but one of the scripts fixes the issue.

I recommend adding a script to both Tilia input prefabs that `OnReset()` checks for enabled instances of `PlayerInput.cs` in the scene hierarchy, and disables it from its own prefab if another instance is active. A debug warning would be useful as well.

贡献指南

打开贡献指南

调研方向

在使用 UnityInputSystem.Poses.GenericXR.prefab 和 UnityInputSystem.InputActionMappings.GenericXR.prefab 的 Windows Mixed Reality Unity 2021.3.24 中重现该问题。检查两个输入 prefab 中的 PlayerInput.cs 实例以及所请求的 OnReset() 行为。完成标准是:构建版本在仅启用一个 PlayerInput.cs 实例的情况下保留控制器输入,并在发现重复实例时提供有用的调试警告。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, unity
领域
game-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。