assetManager.loadRemote<ImageAsset>(resourceUrl, (err, imageAsset) => {
if (err) {
console.debug(err, resourceUrl);
return;
}
this._resource!.preload = true;
if (imageAsset instanceof ImageAsset) {
const spriteFrame = new SpriteFrame();
const texture = new Texture2D();
texture.image = imageAsset;
spriteFrame.texture = texture;
this._resource!.spriteFrame = spriteFrame;
}
this.imageZoomViewer.spriteFrame = this._resource?.spriteFrame;
});
I used loadRemote to load the image even though the image path is correct and I tried downloading a png image but when using loadRemote callback it returns an Assets not an ImageAsset, what is wrong?