Japtor

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.
Japtor
Posts: 5

Pharan

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();
User avatar
Pharan

Pharan
Posts: 5284

Japtor

Hi,

That works perfectly, Thanks!!!! :)
Japtor
Posts: 5


Return to Unity