- Изменено
SkeletonGraphic -> How to change skin?
- Изменено
Hi,
I am creating a UI -> When you click a button, the image (skin) swaps to a random one and uses a specific animation.
For that, I have created a button where inside there is a SkeletonGraphic script. However, I thought by changing the Initial Skin Name by code, (which has at the moment 3 skins) it would swap the skin. But, it doesn't. Is there a way to do it?
Thanks.
InitialSkinName means the skin it starts with.
If you want to change the skin, use skeletonGraphic.Skeleton.SetSkin(skinName);
As with other types, you may also need to make the calls in this sequence.
skeletonGraphic.Skeleton.SetSkin(skinName);
skeletonGraphic.Skeleton.SetSlotsToSetupPose();
skeletonGraphic.LateUpdate();
Hi,
That works perfectly, Thanks!!!!