Merge pull request #55 from chuanweizhang2013/v3luaruntime

fixed bug  scheduleUpdate
This commit is contained in:
cocoscodeide 2014-07-15 15:22:54 +08:00
commit 68369ed2ea
2 changed files with 4 additions and 7 deletions

View File

@ -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);
}

View File

@ -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