xxl

我查阅了文档中有关皮肤的部分,对于皮肤占位符这个概念有点迷惑。

皮肤占位符看起来和附件非常相似:

- 皮肤占位符和附件都是插槽的子物体
- 一个插槽下可以有多个皮肤占位符 / 附件
- 一个插槽下只能显示一个皮肤占位符 / 附件

一个很直接的想法是,通过切换一个插槽下的不同附件,应该就能实现皮肤的效果,那么皮肤占位符的意义是什么,通过切换皮肤占位符来切换不同图片和通过切换附件来切换不同图片,这两者有什么区别。

Slot Head
---- Attachment Red Head
---- Attachment Yellow Head

Slot Head
---- SkinPlaceHolder Red Head
---- ---- Attachment Red Head
---- SkinPlaceHolder Yellow Head
----- --- Attachment Yellow Head
这两者都可以把头在红色头和黄色头之间切换。区别是什么。
什么样的情况我应该用附件来切换,什么样的情况我应该用皮肤占位符来切换。
xxl
  • Messaggi: 21

Misaki

您好。这是个好问题! 我知道,你的问题一开始对很多人来说肯定是个困惑的部分。为了理解这一点,以眼睛为例,而不是以头部为例,会比较容易。

假设睁眼和闭眼都属于一个槽,而且这些槽对每个角色都有不同的形状。例如,女性角色的眼睛可能有长睫毛。让我们假设在使用皮肤之前的设置如下。:

Slot Eyes
---- Attachment Open Eyes
---- Attachment Closed Eyes

使用皮肤,设置将是如下的。:

Slot Eyes
---- SkinPlaceHolder Open Eyes
---- ----Attachment Open Eyes
---- SkinPlaceHolder Closed Eyes
---- ----Attachment Closed Eyes

这种设置允许你用相同的动画对不同皮肤的眼睛进行动画。这就是下面用户指南中的解释。:
动画可以像显示和隐藏附件一样显示和隐藏皮肤占位符,方法是设置插槽附件的关键帧。这样,动画就不再局限于显示和隐藏特定附件。而可以显示和隐藏皮肤占位符,实际显示的附件则来自可见的皮肤,从而使动画能够与任何皮肤一起使用。
Skins - Spine User Guide: Skins

以上希望能为您提供参考。

---

Hi,

It is a good question! I know that your question is certainly a confusing part for many people at first. To understand that, it would be easier to use eyes as an example rather than the head as an example.

Suppose the open and closed eyes belong to a single slot, and these have a different shape for each character. For example, eyes for female characters might have long eyelashes. Let's assume that the setup before using the skin is as follows:

Slot Eyes
---- Attachment Open Eyes
---- Attachment Closed Eyes

Using skins, the setup will be as follows:

Slot Eyes
---- SkinPlaceHolder Open Eyes
---- ----Attachment Open Eyes
---- SkinPlaceHolder Closed Eyes
---- ----Attachment Closed Eyes

This setup allows you to animate the different skins' eyes with the same animations. This is what is explained below in the user guide:
Animations can show and hide skin placeholders just like they do attachments, by keying the slot attachment. By doing this, animations are not tied to showing and hiding specific attachments. Instead, animations show and hide skin placeholders and which attachments are actually shown comes from which skins are visible, enabling animations to be used with any skins.
Skins - Spine User Guide: Skins

I hope this will help you.
Avatar utente
Misaki

Misaki
  • Messaggi: 858

雨之师

充当官方来说下我的个人理解。
当不需要用到皮肤功能(软件功能)的时候,皮肤占位符是没啥用处的。在实现换装这块,一个插槽下多加几个附件就可以实现换装。
当启用皮肤功能后,皮肤功能的好处在于,如果你需要一次换很多东西,通过程序判断或者动画扩展就会显得很麻烦。这个时候,皮肤占位符会记录对应皮肤需要显示的图片资源。在切换到其他皮肤的时候,它也会显示相对应的图片资源或者隐藏和当前皮肤不匹配的图片资源。
这样不同的皮肤可以共用一个状态动画,换皮的时候,不需要挨个替换,只需要切换对应皮肤就可以了。
雨之师
  • Messaggi: 18


Torna a 中国Spine用户