Hi @Davide ,
Before digging into the custom loading, I want to make sure I'm extending the class right. Is this the right way to extend the AssetManager?
class CustomAssetManager extends spine.AssetManager {
loadTextureAtlasButNoTextures(path, success = () => {}, error = () => {}) {
...
}
}
class App {
constructor() {
this.canvas = null;
this.assetManager = new CustomAssetManager();
this.atlas = null;
this.skeletonData = null;
this.skeleton = null;
this.animationState = null;
this.lastBounds = {};
}
loadAssets(canvas) {
this.assetManager.loadBinary('spine-dynamic/animee.skel');
this.assetManager.loadTextureAtlas(
'spine-dynamic/chibi_04_flipbooktest.atlas',
);
initialize(canvas) {
this.canvas = canvas;
let atlas = this.assetManager.require(
'spine-dynamic/chibi_04_flipbooktest.atlas',
);
...
}
const appInstance = new App();
new spine.SpineCanvas(canvas, {
pathPrefix: '/',
app: appInstance,
});
I'm getting errors because in SpineCanvas's waitForAssets, it calls this.assetManager but that is not using my custom asset manager, so initialize() gets called before loadAssets() can finish. Am I not extending the asset manager properly?
Thanks!