十九点半的钟声

大家好,在下是刚刚学习 Spine 的菜鸟程序员一枚,遇到了一个问题,就是在我想通过其他文件里的动画应用到正在使用中的对象里时,如果还是用普通的载入方法那 json、atlas、png 都要载入一遍,势必会影响读取速度,看官方的运行库文档资料也少的可怜,实在弄不明白了,希望有大佬能帮帮忙指点一下~
Benutzeravatar
十九点半的钟声
  • Beiträge: 4

Harald

您正在使用哪个运行时?
Which runtime are you using?
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

十九点半的钟声

Harald hat geschrieben:您正在使用哪个运行时?
Which runtime are you using?
在Unity中使用
Use in Unity
Benutzeravatar
十九点半的钟声
  • Beiträge: 4

Harald

您好,欢迎来到Spine!
Hello and welcome to Spine!

我是否正确理解了您的问题,即您已在多个Spine项目文件中或至少在多个导出的.json文件中分发了动画? 您是否要将这些多个动画json文件导入到Unity中的单个骨架(例如SkeletonAnimation)?
Did I understand your question correctly that you have distributed animations across multiple Spine project files, or at least across multiple exported .json files? And that you want to import these multiple animation json files to a single skeleton in Unity (e.g. SkeletonAnimation)?

如果是,那么我担心Spine运行时不支持从多个.json文件导入到单个字符。
If yes, then I fear that importing from multiple .json files to a single character is not supported by the Spine runtimes.

但是,在Spine编辑器中,您可以轻松地从其他Spine项目文件中导入动画,以获得包含所有动画的组合项目。 这可以通过“脊椎菜单->导入项目”,然后选择“动画”并将其指向相应的脊椎项目文件的路径来完成。 然后,您可以导出包含所有动画的单个.json文件。
However, in the Spine Editor you can easily import animations from other Spine project files to get a combined project with all animations. This can be done via Spine menu -> Import Project and then selecting Animation and pointing it to the path of the respective Spine project file. Then you can export a single .json file with all animations.
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

十九点半的钟声

Harald hat geschrieben:您好,欢迎来到Spine!
Hello and welcome to Spine!

我是否正确理解了您的问题,即您已在多个Spine项目文件中或至少在多个导出的.json文件中分发了动画? 您是否要将这些多个动画json文件导入到Unity中的单个骨架(例如SkeletonAnimation)?
Did I understand your question correctly that you have distributed animations across multiple Spine project files, or at least across multiple exported .json files? And that you want to import these multiple animation json files to a single skeleton in Unity (e.g. SkeletonAnimation)?

如果是,那么我担心Spine运行时不支持从多个.json文件导入到单个字符。
If yes, then I fear that importing from multiple .json files to a single character is not supported by the Spine runtimes.

但是,在Spine编辑器中,您可以轻松地从其他Spine项目文件中导入动画,以获得包含所有动画的组合项目。 这可以通过“脊椎菜单->导入项目”,然后选择“动画”并将其指向相应的脊椎项目文件的路径来完成。 然后,您可以导出包含所有动画的单个.json文件。
However, in the Spine Editor you can easily import animations from other Spine project files to get a combined project with all animations. This can be done via Spine menu -> Import Project and then selecting Animation and pointing it to the path of the respective Spine project file. Then you can export a single .json file with all animations.
是的,您理解的是正确的。
Yes, your understanding is correct.

但是目前游戏的程序设计上是希望可以使用一个通用的Spine项目(使用同一个Skeleton),然后从文件载入动画,如果玩家不喜欢原来的动作可以自己制作简单的动作MOD,对 Idle、Walk、Run......等动作进行单独的替换。这样只需要导入对应动作即可支持新的武器类型。
However, the current program design of the game hopes to use a universal Spine project (using the same Skeleton) and then load the animation from the file. If the player does not like the original action, he can make a simple action MOD by himself. For Idle, Walk, Run...The action performs a separate substitution.This only needs to import the corresponding action to support the new weapon type.

我们真的很需要这样的功能 o(╥﹏╥)o。
We really need that o(╥﹏╥)o。
Benutzeravatar
十九点半的钟声
  • Beiträge: 4

Harald

您将不得不编写自己的其他加载代码,以将时间轴追加到现有的SkeletonData.Animations:
You would have to write your own additional loading code to append Timelines to the existing SkeletonData.Animations:
skeletonAnimation.Skeleton.Data.Animations.Add(animation)
请注意,一个SkeletonData对象的动画不能简单地附加到另一个对象上,因为某些时间轴存储的是引用而不是索引,这将是错误的。
这是存储附件引用而不是索引的示例:
spine-runtimes/SkeletonJson.cs at 3.8
Just beware that animations of one SkeletonData object cannot simply be appended to another one, since some Timelines store references instead of indices, which will the will be wrong.
This is an example where an Attachment reference is stored instead of indices:
spine-runtimes/SkeletonJson.cs at 3.8

因此,您需要编写自己的代码来读取json /二进制资产,并将动画附加到现有的SkeltonData对象上,就像 SkeletonJsonSkeletonBinary 类一样。
So you would need to write your own code that reads a json/binary asset and appends the animations to an existing SkeltonData object, just as the SkeletonJson or SkeletonBinary class does.
Benutzeravatar
Harald

Harri
  • Beiträge: 1096

十九点半的钟声

Harald hat geschrieben:您将不得不编写自己的其他加载代码,以将时间轴追加到现有的SkeletonData.Animations:
You would have to write your own additional loading code to append Timelines to the existing SkeletonData.Animations:
skeletonAnimation.Skeleton.Data.Animations.Add(animation)
请注意,一个SkeletonData对象的动画不能简单地附加到另一个对象上,因为某些时间轴存储的是引用而不是索引,这将是错误的。
这是存储附件引用而不是索引的示例:
spine-runtimes/SkeletonJson.cs at 3.8
Just beware that animations of one SkeletonData object cannot simply be appended to another one, since some Timelines store references instead of indices, which will the will be wrong.
This is an example where an Attachment reference is stored instead of indices:
spine-runtimes/SkeletonJson.cs at 3.8

因此,您需要编写自己的代码来读取json /二进制资产,并将动画附加到现有的SkeltonData对象上,就像 SkeletonJsonSkeletonBinary 类一样。
So you would need to write your own code that reads a json/binary asset and appends the animations to an existing SkeltonData object, just as the SkeletonJson or SkeletonBinary class does.
Ok, thank you very much
Benutzeravatar
十九点半的钟声
  • Beiträge: 4


Zurück zu 中国Spine用户