var HelloWorldLayer = cc.Layer.extend({
score:
0
,
ctor:function () {
this
.score +=
1
;
cc.director.runScene(
new
EndScene(
this
.score));
}
)};
//场景2
var EndScene = cc.Scene.extend({
_score:
null
,
ctor:function(args){
this
._super();
this
._score = args;
},
onEnter:function () {
this
._super();
cc.log(
"this._score = %d"
,
this
._score);
//这个时候score就有了
}
});