Harald Sure, Thanks so much for your help.
This is the code function for the temporary test
public static Skin tempSkin = new Skin("temp");
public static void ReplaceOptionSkin(SkeletonAnimation aim_Ani, int slot_Num, string skin_Name, int skin_Num)
{
SkeletonDataAsset skeletonDataAsset = aim_Ani.SkeletonDataAsset;
var dataAsset = skeletonDataAsset.GetSkeletonData(true);
var defaultSkin = dataAsset.FindSkin("default");
Attachment templateAttachment = defaultSkin.GetAttachment(slot_Num, skin_Name);
var path = string.Format("BodyParts/{0}/{1}", skin_Num, skin_Name);
Sprite s = Resources.Load<Sprite>(path);
if (s == null)
{
Debug.Log("NoTextures" + skin_Name);
return;
}
Attachment newattach = templateAttachment.GetRemappedClone(s, defaultMats, true);
tempSkin.SetAttachment(slot_Num, skin_Name, newattach);
aim_Ani.Skeleton.SetSkin(tempSkin);
aim_Ani.Skeleton.SetSlotsToSetupPose();
aim_Ani.AnimationState.Apply(aim_Ani.Skeleton);
}
And the input Settings for the Sprite:
After then I tried to change the size of the package atlas(256×1024 using Spine's own atlas packing),Face is now working properly when replacing sprite,but eyelash is the opposite(Because It's rotated 90 in the region of the atlas like the face's region before).
So I unchecked the rotation when the atlas was packed ,Everything is correct.
As beginner in the spine-unity workflow ,Sorry I didn't carefully understand the function of Spine.
I wonder if this is the cause of the problem?
Will the replacement sprite rendered in the attachment be affected by the clipping position and rotation of the region area in the packed atlas?
Is it the same situation when RegionAttachment replace skin?
I want know packing atlas without setting rotate will takes up a lot of memory to load if I have a lot of Spine animations?