The loader plugin can currently load all assets from an asset-pack via scene.load.pack(...), but it lacks the functionality for unloading an asset-pack.
Since the pack function must already have the code to read and iterate through assets in an asset-pack, maybe something like scele.load.unloadAssetPack(...) can be easy to implement, as it would just have to call destroy instead of load for each asset in the asset-pack.
Motivation:
Building multi-scene games for mobile with lots of assets can be difficult to do without this, as it requires the developer to track every asset it loads and manually and individually unload it when needed. This is almost like managing an asset-pack manually and it kind of defeats the purpose of the builtin asset-pack.
Pretty much all game engines support something along the lines of unload unused assets or unload asset bundle or unload scene (which also unloads the assets).
The loader plugin can currently load all assets from an asset-pack via
scene.load.pack(...)
, but it lacks the functionality for unloading an asset-pack.Since the
pack
function must already have the code to read and iterate through assets in an asset-pack, maybe something likescele.load.unloadAssetPack(...)
can be easy to implement, as it would just have to calldestroy
instead ofload
for each asset in the asset-pack.Motivation: Building multi-scene games for mobile with lots of assets can be difficult to do without this, as it requires the developer to track every asset it loads and manually and individually unload it when needed. This is almost like managing an asset-pack manually and it kind of defeats the purpose of the builtin asset-pack. Pretty much all game engines support something along the lines of
unload unused assets
orunload asset bundle
orunload scene (which also unloads the assets)
.