sorry i did not do a good job asking the question. let me try that again.
there's 2 same SkeletonAnimation in 2 different scenes. call it Scene1 and Scene2.
i first generate a skin with
repackedSkin = holderSkin.GetRepackedSkin("repacked_skin", skeletonRenderer.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial, out Material runtimeMaterial, out Texture2D runtimeAtlas, maxSpriteSize);
and stored it in a static variable from Scene1.
after switching scene from Scene1 to Scene2, I will call SkeletonAnimation.Initialize(true) and AssignCachedSkin() (method from original question) in Scene2.
AssignCachedSkin parameter is taken from the skin stored in the static variable previously in Scene1.
However, the attachments are not animating at the desired position. It works perfectly fine when I call the full SetAttachment flow instead of AssignCachedSkin()
skeletonRenderer.Skeleton.Skin.Clear(); this line was added out of desperation.. and it did not seems to solve the issue. I will remove that line 🙂
What do you mean by placeholder position? Do you mean they reset back to the default skin's attachment? What does your default skin contain (e.g. when you select it in the preview of the SkeletonDataAsset in the Inspector)?
we combined a lot of skins together, our default skin got nothing other than shadow.