diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp index a053d9298e..53e246faa0 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp @@ -94,10 +94,7 @@ bool reloadScript(const string& modulefile) director->getTextureCache()->removeAllTextures(); } FileUtils::getInstance()->purgeCachedEntries(); - - director->getScheduler()->unscheduleAll(); - director->getScheduler()->scheduleUpdate(director->getActionManager(), Scheduler::PRIORITY_SYSTEM, false); - + return (LuaEngine::getInstance()->reload(strfile.c_str())==0); } diff --git a/templates/lua-template-runtime/src/main.lua b/templates/lua-template-runtime/src/main.lua index c17b3f79b1..6d88fc84d9 100644 --- a/templates/lua-template-runtime/src/main.lua +++ b/templates/lua-template-runtime/src/main.lua @@ -30,11 +30,11 @@ local function main() gameScene = scene.create() gameScene:playBgMusic() - if cc.Director:getInstance():getRunningScene() then + if cc.Director:getInstance():getRunningScene() then cc.Director:getInstance():replaceScene(gameScene) - else + else cc.Director:getInstance():runWithScene(gameScene) - end + end end