From c36df9c527f88002389de29e7489f25e88fa7765 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 12 Jan 2016 18:19:30 +0800 Subject: [PATCH] Fix issue of replace scene in event callback in JSB --- jsb/jsb-director.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jsb/jsb-director.js b/jsb/jsb-director.js index d5a9ef5bfd..61471966b6 100644 --- a/jsb/jsb-director.js +++ b/jsb/jsb-director.js @@ -141,7 +141,10 @@ cc.js.mixin(cc.director, { this.runWithScene(sgScene); } else { - this.replaceScene(sgScene); + // Delay to avoid issues like transition in event callback + this.once(cc.Director.EVENT_AFTER_DRAW, function () { + this.replaceScene(sgScene); + }); } // Activate