我正在使用Cocos2D v1.0.1,我有一个关于此代码的错误
CCScene *scene = [TDGameHandler scene:kGameSolo andViewController:self];
if(![[CCDirector sharedDirector] runningScene])
{
[[CCDirector sharedDirector] runWithScene:scene]; // RUN THE SCENE
} else {
[[CCDirector sharedDirector] replaceScene:scene];
}
第一次没有问题,但第二次没有图像加载。 我试图弹出并推动场景,但它也没有用,我也尝试添加startAnimation但应用程序崩溃。
我只是试图用这段代码结束CCScene:
[[CCDirectorIOS sharedDirector] end];
[[CCDirector sharedDirector] runWithScene:scene];
但它崩溃了。
感谢您的帮助。
答案 0 :(得分:0)
try this:
[[CCDirector sharedDirector] replaceScene: [TDGameHandler scene]];