我正在使用Unity XR在Unity中开发VR应用程序。 编程一段时间后,我的控制台反复显示相同的错误:
XRStats :: SetStatFloat失败。统计资料已满!此框架的统计数据 将丢失。
我读到您应该删除 Test framework package ,但这没有成功。
void Start()
{
List<InputDevice> devices = new List<InputDevice>();
InputDeviceCharacteristics rightControllerCharacteristics = InputDeviceCharacteristics.Right | InputDeviceCharacteristics.Controller;
InputDevices.GetDevicesWithCharacteristics(rightControllerCharacteristics, devices);
foreach (var item in devices)
{
Debug.Log(item.name + item.characteristics);
}
if(devices.Count > 0)
{
targetDevice = devices[0];
}
}
void Update()
{
targetDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool primartButtonValue);
if (primartButtonValue)
{
Debug.Log("Primary trigger");
}
targetDevice.TryGetFeatureValue(CommonUsages.trigger, out float triggerValue);
}
我删除了上面引用的脚本,但仍然收到相同的消息。我尝试删除并安装所有XR插件,但没有任何效果。