【问题标题】:Chipmunk Error: Cannot remove a body that was not added to the space while changing scenes花栗鼠错误:更改场景时无法移除未添加到空间的身体
【发布时间】:2015-09-17 00:26:28
【问题描述】:

我正在尝试使用 spritebuilder 在 Swift 中制作游戏。我可以从我的主场景中更改场景,但是当我尝试从切换到的场景中切换场景时,应用程序崩溃并出现以下错误:

Aborting due to Chipmunk error: Cannot remove a body that was not added to the space. (Removed twice maybe?)

我从不使用cpSpaceRemoveBody函数,并且在线程1中,remove被自动调用了两次(我认为这是问题所在)。

我正在使用以下方式切换场景:

let scene = CCBReader.loadAsScene("Gameover")
CCDirector.sharedDirector().presentScene(scene)

我一直在寻找,但找不到任何关于为什么会发生这种情况的信息。

【问题讨论】:

    标签: swift scene spritebuilder


    【解决方案1】:

    嗯,这很尴尬。我没有 onExit 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多