Skip to content

Commit ab74714

Browse files
committed
Resolve bug of SceneTest case
Touch event for pop a scene in ctor function but this will trigger bug while the touch pop the TransitionScene
1 parent 6bac074 commit ab74714

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/SceneTest/SceneTest.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ var SceneTestLayer3 = cc.LayerColor.extend({
153153
ctor:function () {
154154
this._super();
155155
this.init( cc.c4b(0,128,255,255) );
156-
157-
if( 'touches' in sys.capabilities )
158-
this.setTouchEnabled(true);
159-
else if ('mouse' in sys.capabilities )
160-
this.setMouseEnabled(true);
161-
156+
162157
var label = cc.LabelTTF.create("Touch to popScene", "Arial", 28);
163158
this.addChild(label);
164159
var s = director.getWinSize();
@@ -172,6 +167,13 @@ var SceneTestLayer3 = cc.LayerColor.extend({
172167
var repeat = cc.RepeatForever.create(rotate);
173168
sprite.runAction(repeat);
174169
},
170+
171+
onEnterTransitionDidFinish: function () {
172+
if ('touches' in sys.capabilities)
173+
this.setTouchEnabled(true);
174+
else if ('mouse' in sys.capabilities)
175+
this.setMouseEnabled(true);
176+
},
175177

176178
testDealloc:function (dt) {
177179

0 commit comments

Comments
 (0)