Hi,
I need to load lots of assets, but not all at the same time.
Can I load assets like below and do that multiple times (each time with other assets off course)?
I ask this because it uses app.assets. And I’m not sure if the registry is reusable. Can you add multiple times to the registry?
(and do I need to keep the myAssets object in memory?)
const myAssets = {
wormholeWall: new pc.Asset('wormholeWall', 'container', {
url: '/assets/models/wormhole/WormholeWall.glb',
}),
wormholeWall_wireframe: new pc.Asset('wormholeWall_wireframe', 'container', {
url: '/assets/models/wormhole/WormholeWall.glb',
}),
thing: new pc.Asset('thing', 'container', {
url: '/assets/models/div/statue.glb',
}),
};
const assetListLoader = new pc.AssetListLoader(Object.values(myAssets), app.assets);
assetListLoader.load((err, failed) => {
if (err) {
console.log(`assets failed to load: ${err}`);
} else {
console.log(`assets loaded`);
}
});