统一加载另一个场景

时间:2014-09-29 13:14:42

标签: unity3d

在用于统一的kinect 1.7包装程序包中,当在场景之间切换时,我收到错误“只能有一个kinectsensor实例。”任何人都可以提出解决方案吗?

1 个答案:

答案 0 :(得分:0)

从此

更改脚本
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
}

如果这不起作用,可能会在转移到第二个场景时删除第一个场景的相机。