2.1>在secondScene.h 中加入成員變量,如 int sceneNum;
並在secondScene.cpp的init()方法裏,sceneNum = 0;//能夠省略這句
2.2>在firstScene轉到第二場景時,調用如下方法
CCScene
*
scene
=
CCScene
::
create
();
secondScene
*
layer
=
secondScene
::
create
();
layer
->
sceneNum
=
1
;
scene
->
addChild
(
layer
);
CCDirector
::
sharedDirector
()->
replaceScene
(
CCTransitionFade
::
create
(
1.5f
,
scene
));
3>參考