You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When everything (the game js-files and the framework-js-files) is minimized, the project.json jsList is empty and therefore _prepared will never be set to true. Normally this is no problem but we use cc.game._prepared in our game (webworkers) to check if the engine is prepared (everything is loaded).
The text was updated successfully, but these errors were encountered:
hamburml
changed the title
_prepared is never set to true when js-files are minimized
_prepared is never set to true when js-files are minimized (project.json does not contain a jsList)
Oct 25, 2017
Maybe a better approach would be adding a method to cc.game called isReady() to indicate if everything is loaded. _prepared is "private" var (starts with underscore by convention) - I would no rely on it for any sort of info.
_prepared is set to false when created (https://github.com/cocos2d/cocos2d-html5/blob/develop/CCBoot.js#L2365)
_prepared is set to true when the project.json file has a jsList which is loaded AFTER the cocos2d-html5 files were loaded (https://github.com/cocos2d/cocos2d-html5/blob/develop/CCBoot.js#L2553)
When everything (the game js-files and the framework-js-files) is minimized, the project.json jsList is empty and therefore _prepared will never be set to true. Normally this is no problem but we use
cc.game._prepared
in our game (webworkers) to check if the engine is prepared (everything is loaded).I am not sure but it should be sufficient if
self._prepared = true
is set here https://github.com/cocos2d/cocos2d-html5/blob/develop/CCBoot.js#L2563 or the project.json contains"jsList": []
.What do you say?
Thanks!
The text was updated successfully, but these errors were encountered: