RT。
代码如下:
实例化没有报错,但是动画不显示。
有没有大佬做过类似的需求?请指教一下。急。
这里填你文件格式,比如.atlas .json
好的,我试试。
还是不行。没显示。
showNetSpine(url, skeleton, cb) {
let image = url.png;
let ske = url.json;
let atlas = url.atlas;
let arr = image.split('/');
let textureNames = arr[arr.length - 1];
cc.assetManager.loadAny([{ url: atlas, ext: '.atlas' }, { url: ske, ext: '.json' }], (error, assets) => {
let png = Utils.formatPng(url);
cc.assetManager.loadRemote(image, png, (error, texture) => {
let asset = new sp.SkeletonData();
asset.skeletonJson = assets[1];
asset.atlasText = assets[0];
asset.textures = [texture];
asset.textureNames = [textureNames];
skeleton.skeletonData = asset;
cb && cb();
});
});
}
这是 3.x 的?看有没有可能是 spine 节点的 layer 不是 UI_2D,导致没渲染出来?
是3.0的,谢谢。我去试试。
是的,可以了。感恩。
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。