Hey,
I'm trying to create and attach attachments during runtime to a skin then attach the skin to a skeleton. The problem is the attachments aren't showing up even though they are visible in the inspector and turned on. The weird thing is that if I call setColor on the attachments, they show up properly colored. Is that an inspector bug and they are actually off or am I forgetting something? Below is the code I am using to create and attach the attachment to the skin. The slot is not a spine slot, it's only used for its name and the slotSprite is a local unity sprite , and customSkin is the skin.
SlotData oldSlot = skeletonRenderer.skeleton.data.FindSlot(slot.slotName);
var loader = new SpriteAttachmentLoader(slotSprite, Shader.Find("Spine/Bones"));
var att = loader.NewRegionAttachment(CustomSkin, slot.slotName, slotSpritePath);
loader = null;
RegionAttachment newAttachment = att;
oldSlot.AttachmentName = slot.slotName;
CustomSkin.AddAttachment(skeletonRenderer.skeleton.data.FindSlotIndex(slot.slotName), slot.slotName, newAttachment);
skeletonRenderer.skeleton.SetSkin(CustomSkin);
skeletonRenderer.skeleton.SetSlotsToSetupPose();