【发布时间】:2014-09-29 13:14:42
【问题描述】:
在用于统一的 kinect 1.7 包装器包中,在场景之间切换时出现错误“只能有一个 kinectsensor 实例。”任何人都可以提出解决方案吗?
【问题讨论】:
-
检查您的游戏对象及其组件。我不熟悉这个包,但听起来两个对象具有相同的组件,只能一次处于活动状态 或仅存在于一个地方。这听起来类似于相机对象上的侦听器。确保场景中只存在一个。
标签: unity3d
在用于统一的 kinect 1.7 包装器包中,在场景之间切换时出现错误“只能有一个 kinectsensor 实例。”任何人都可以提出解决方案吗?
【问题讨论】:
标签: unity3d
从此更改脚本
if (KinectSensor.instance != null)
{
Debug.Log("There should be only one active instance of the KinectSensor component at at time.");
throw new Exception("There should be only one active instance of the KinectSensor component at a time.");
}
到
if (KinectSensor.instance != null)
{
Debug.Log("There should be only one active instance of the KinectSensor component at at time.");
KinectSensor.instance = null; // Add this one
}
如果这不起作用,可能会在转移到第二个场景时删除您的第一个场景的相机。
【讨论】: