I’m trying to figure out if theres a way to know when all dependencies (children) of a template asset are loaded as I want to instantiate it to the scene.
Using asset.ready doesnt work since it seems to fire as soon as the parent asset is loaded without waiting for the rest.
var self = this;
var onAssetsLoaded = function(asset)
{
let go = self.prefab.resource.instantiate();
go.setPosition(0, 0, 0);
self.app.root.addChild(go);
};
self.prefab.ready(onAssetsLoaded);
this.app.assets.load(this.prefab);