感谢您再次与我们联系,我想我现在可以理解您正在努力实现的目标。
不幸的是,没有一种简便的方法可以从Spine Editor导出单独的皮肤描述文件。当将骨架导出为.json时,文件将始终包含“骨骼”和“插槽”部分以及“皮肤”部分。目前暂时无法单独导出。
您需要做的是创建一个脚本(例如在python中)或一个在导出后会自动调用的应用程序。然后,此脚本将从一个完整的骨架文件中创建两个单独的.json
文件:一个没有.skins部分的.json
文件,以及一个仅包含skins
部分的文件。然后,您可以在运行时下载文件的两部分并以编程方式连接文件内容。然后,您需要在“ SkeletonDataAsset”处分配它,以像在正常工作流程中那样加载它。您仍然需要手动下载并分配Atlas资产和png文件,因为如果您担心大小,还需要按需下载它们。
请注意,将皮肤与骨骼分离不会获得太多收益。将皮肤与骨骼,插槽和动画一起导出为二进制.skel.bytes文件而不将其分为两个文件,效率最高。无论如何,纹理很可能会主导下载大小。因此,如上所述,您可能需要考虑按需下载和分配纹理参考。
Thanks for getting back to us, I think I can now understand what you are trying to achieve.
Unfortunately there is no comfortable way to export separate skin description files from the Spine Editor. When exporting a skeleton as .json
, the file will always contain both the bones
and slots
section, as well as the skins
section. It cannot be exported separately for now.
What you would need to do is create a script (e.g. in python) or an application which is called automatically after export. This script would then create two separate .json
files from one complete skeleton file: one .json
file without the skins
section, and one containing only the skins
section. Then you could at runtime download both parts of the file and concatenate the file content programmatically. Then you would need to assign it at a SkeletonDataAsset
to load it as it would do in the normal workflow. You would still need to manually download and assign the atlas asset and png files, as you will also want to download them on demand if size is of concern.
Please note that you will not gain much by separating skins from a skeleton. It is most likely much more efficient to export the skin together with the bones, slots and animations as a binary .skel.bytes
file and not separate it into two files. The textures will most likely dominate the download size anyway. So as mentioned in postings above, you might want to consider downloading and assigning texture references on demand.