Hey,
We have a couple of helmets for our characters. The helmets share a skin-placeholder, but some helmets also have a light that is assigned to that skin. In the Spine Editor when pinning a helmet, then another one and unpinning the previous one, it behaves as we expect, the placeholder is replaced, and the extra light attachment is turned off.
In unity the extra attachment lingers around, the stuff in the placeholders is replaced, but the light would just stay visible, even though the skin was removed from the newly applied mixAndMatch skin.
We can fix this by adding every single skin attachment to their own skin placeholder, but this would require a lot of extra work. Do I need to refresh or update anything additionally in Unity?
internal void SetSkin(string skinName)
{
m_activeSkinList.Add(skinName);
UpdateSkin();
}
internal void RemoveSkin(string skinName)
{
m_activeSkinList.Remove(skinName);
UpdateSkin();
}
internal void UpdateSkin()
{
var skeleton = m_skeletonAnimation.Skeleton;
var skeletonData = skeleton.Data;
var mixAndMatchSkin = new Skin("skin_match");
for (int i = 0; i < m_activeSkinList.Count; i++)
{
Skin skin = skeletonData.FindSkin(m_activeSkinList[i]);
if (skin != null)
mixAndMatchSkin.AddSkin(skin);
}
skeleton.SetSkin(mixAndMatchSkin);
skeleton.SetSlotsToSetupPose();
m_skeletonAnimation.AnimationState.Apply(m_skeletonAnimation.Skeleton);
ColorTeam();
}
Thank you!