我有这两个场景,一个菜单场景和一个主游戏场景。主游戏场景附有两个单层图层,这是我所有游戏内容的所在。
我使用 replaceScene 方法从游戏场景切换回菜单场景,但是当我切换回游戏场景时,控件或触摸被冻结。
这是主要的游戏场景代码:
#import "BJPlayfieldScene.h"
@implementation BJPlayfieldScene
+(id)scene {
return( [ [ self alloc ] init ] );
}
-(id) init
{
if( (self=[super init])) {
//Background Layer
[self addChild:[BackgroundLayer sharedBackground] z:0];
//playfiled layer
[self addChild:[BJPlayfieldLayer sharedfieldlayer] z:5];
}
return self;
}
@end
然后是切换回来和第四的代码:
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:[IntroLayer scene]]];
和
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:
[BJPlayfieldScene scene ] ]];
有任何想法吗?
谢谢一堆