gpt4 book ai didi

swift - 花栗鼠错误: Cannot remove a body that was not added to the space while changing scenes

转载 作者:行者123 更新时间:2023-11-30 14:04:06 24 4
gpt4 key购买 nike

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

由于花栗鼠错误而中止:无法删除未添加到空间中的主体。 (也许被删除了两次?)

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

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

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

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

最佳答案

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

关于swift - 花栗鼠错误: Cannot remove a body that was not added to the space while changing scenes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32620791/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com