【问题标题】:Loading another scene in unity统一加载另一个场景
【发布时间】:2014-09-29 13:14:42
【问题描述】:

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

【问题讨论】:

  • 检查您的游戏对象及其组件。我不熟悉这个包,但听起来两个对象具有相同的组件,只能一次处于活动状态仅存在于一个地方。这听起来类似于相机对象上的侦听器。确保场景中只存在一个。

标签: unity3d


【解决方案1】:

从此更改脚本

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
}

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

【讨论】:

    猜你喜欢
    • 2022-11-15
    • 1970-01-01
    • 2021-05-22
    • 2012-11-09
    • 2015-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多