我还没有完成调查。 我使用了 woshi4.0.spine 项目文件,因为它是唯一一个带有“fs_zj_lie_4000_pj_wake”动画的文件。 我在 Spine 4.1.08 中打开它并将其导出为 .json。 使用以下设置导出地图集:
I have no finished the investigation. I used the woshi4.0.spine project file, as that was the only one with the "fs_zj_lie_4000_pj_wake" animation. I opened it in Spine 4.1.08 and exported it to .json. The atlas was exported with these settings:
然后我使用了最新的 spin-player 版本(NPM 上的 4.1.22),它与 GitHub 上 4.1 分支中的 spin-player 源相同。 然后我写了这个小 .html 文件:
I then used the latest spine-player release (4.1.22 on NPM), which is the same as the spine-player sources in the 4.1 branch on GitHub. I then wrote this little .html file:
<body>
<div id="container" style="width:100%; height:100vh"></div>
</body>
<script>
new spine.SpinePlayer("container", {
jsonUrl: "assets/woshi.json",
atlasUrl: "assets/woshi4.0.atlas",
animation: "fs_zj_lie_4000_pj_wake",
premultipliedAlpha: true,
backgroundColor: "#cccccc",
viewport: {
debugRender: true,
},
showControls: true,
});
</script>
我在运行的真实 iOS 设备上对此进行了测试,得到了正确的结果:
I tested this on a real iOS device running, which gives this correct result:
将 woshi4.0.spine 项目导出为 .json 时,我确实注意到版本设置为 4.0 而不是 4.1。 当您使用 spin-player 4.1.22 渲染它时,这将导致文件不兼容。 请确保您使用与您使用的 Spine 运行时的 x.y 版本相同的 x.y Spine Editor 版本导出您的资产。 例如。 从 Spine Editor 4.1.08 导出,将版本字段保留为 4.1,并使用 spin-player 4.1.22。
When exporting the woshi4.0.spine project to .json, I did notice that the version was set to 4.0 instead of 4.1. This will result in an incompatible file when you render it with spine-player 4.1.22. Please make sure you export your assets with the same x.y Spine Editor version as the x.y version of the Spine Runtimes you use. E.g. export from Spine Editor 4.1.08, leaving the version field at 4.1, and use the spine-player 4.1.22.