Hi, currently I working on a project which need to load .png .atlas and .json from AWS S3 to change spine animation on runtime. The spine animation with only 1 png will work but with multi png can’t work. This is the code for loading file from S3.
var atlas = filePath + this.onlyFileName + ‘.atlas’;
cc.loader.load({ url: atlas, type: ‘txt’ }, (error, atlasJson) => {
var ske = filePath + this.onlyFileName + '.json';
cc.loader.load({ url: ske, type: 'txt' }, (error, spineJson) => {
var image = filePath + this.onlyFileName + pngFileType;
cc.loader.load(image, (error, textures) => {
var asset = new sp.SkeletonData();
asset.textures = [textures];
asset.textureNames = [this.onlyFileName + pngFileType];
if(totalFileMatch>1){
for (var i = 2; i <= sameFile; i++) {
image = filePath + this.onlyFileName + i + pngFileType;
asset.textureNames.push(this.onlyFileName + i + pngFileType);
cc.loader.load(image, (error, textures) => {
asset.textures.push(textures);
});
};
}
asset.skeletonJson = spineJson;
asset.atlasText = atlasJson;
skeleton.skeletonData = asset;
});
});
});
Any one know how to load multi image for spine?