I’m trying to speed up asset load times by not putting all assets in resource.js but using cc.Loader.preloadAsync to load additional assets after the game has started.
This seems to work, but I’m not sure if I’m seeing any large decrease in load times.
Is this likely to help???
Thanks
Roger
var res = [
//image
{type:"plist",src:"res/mc_2.plist"},
{type:"image",src:"res/mc_2.png"},
{type:"plist",src:"res/mc_3.plist"},
{type:"image",src:"res/mc_3.png"},
{type:"plist",src:"res/mc_4.plist"},
{type:"image",src:"res/mc_4.png"},
{type:"plist",src:"res/mc_5.plist"},
{type:"image",src:"res/mc_5.png"},
{type:"plist",src:"res/mc_6.plist"},
{type:"image",src:"res/mc_6.png"},
];
cc.Loader.preloadAsync(res, this.preloadComplete, this);
I’m not sure when preloadAsync was added, but it doesnt give any errors and it appears to work, i.e I appear to be able omit resources from the initial preload (ie not put in them in resource.js)
I’ll need to double check, but I thought if I don’t preload, then assets are not available in the main part of a game etc
Ah yeah my bad, the loader class is actually a lot different, and works a lot better!
As for the async loading, it appeared to work as intended for me.
As far as assets not being available if you don’t preload them, I don’t think that is the case, they would just be loaded at the point of use. I’m not positive on that one though.