Error in adding spine from remote.
Following this link : https://docs.cocos.com/creator/3.6/manual/en/asset/spine.html?h=skeletal%20animation%20assets
also found this https://discuss.cocos2d-x.org/t/how-to-dynamically-load-spine-animations-from-a-server/46117 on discuss but it is of no use
@ccclass("spineAnim")
export class spineAnim extends Component {
start() {
let image = "http://127.0.0.1:8887/maskLeft.png";
let ske = "http://127.0.0.1:8887/maskLeft.json";
let atlas = "http://127.0.0.1:8887/maskLeft.atlas";
assetManager.loadRemote(image, (error, texture: Texture2D) => {
if (error) {
console.log(error);
} else {
assetManager.loadAny(
[
{ url: atlas, ext: ".txt" },
{ url: ske, ext: ".txt" },
],
(finished, total, item) => {
console.log(finished, total, item);
},
(err, imageAsset) => {
if (err) {
console.log(err);
} else {
console.log("texture", texture);
console.log("JSON", imageAsset[1]);
console.log("Atlas", imageAsset[0]);
let asset = new sp.SkeletonData();
asset.skeletonJson = imageAsset[1];
asset.atlasText = imageAsset[0];
asset.textures = [texture];
asset.textureNames = ["maskLeft.png"];
this.node.getComponent(sp.Skeleton).skeletonData = asset;
}
}
);
}
});
}
}
Assets are loaded successfully but the error is:
skeleton-texture.ts:50 Uncaught TypeError: this.getRealTexture(…).setFilters is not a function
at SkeletonTexture.setFilters (skeleton-texture.ts:50:36)
Cocos version 3.6.2