Hello!
I am fighting with a problem for a few days now. I am creating a new skin from different other skins to combine them. When the skin is set all attachments are visible in the skeleton utility but they are disabled. I can enable it by hand and they become visible. But when I start an animation all attachments are disabled again. :bang:
My question is now why is that and how can i fix it?
Best regards!
public SkeletonDataAsset skeletonDataSource;
[SpineAttachment(currentSkinOnly: false, returnAttachmentPath: true, dataField: "skeletonDataSource")]
public List<string> attachmentPath;
[SpineSlot]
public List<string> targetSlot;
for (int i = 0; i < attachmentPath.Count; i++)
{
string path = attachmentPath[i];
if (path.Contains("creativity"))
{
path = attachmentPath[i].Replace("_1_1", "_" + CreativityType + "_" + CreativityLevel);
}
if (path.Contains("fitness"))
{
path = attachmentPath[i].Replace("_1_1", "_" + FitnessType + "_" + FitnessLevel);
}
if (path.Contains("logic"))
{
path = attachmentPath[i].Replace("_1_1", "_" + LogicType + "_" + LogicLevel);
}
customSkin.AddAttachment(skeletonAnimation.skeleton.FindSlotIndex(targetSlot[i]), path, SpineAttachment.GetAttachment(path, skeletonDataSource));
}
skeletonAnimation.skeleton.data.skins.Add(customSkin);
skeletonAnimation.skeleton.SetSkin("CustomSkin");
skeletonAnimation.skeleton.SetSlotsToSetupPose();