nicmar

Breaking change: Removed SkeletonData and Skeleton methods: FindBoneIndex, FindSlotIndex. Bones and slots have an Index field that should be used instead. Be sure to check for e.g. bone == null accordingly before accessing bone.Index.
I used to have this code:
var slotIndex = skeleton.FindSlotIndex(slotName); // You can access GetAttachment and SetAttachment via string, but caching the slotIndex is faster.
I couldn't find .Index on slot, I only found SequenceIndex
var slot = skeleton.FindSlot(slotName); // You can access GetAttachment and SetAttachment via string, but caching the slotIndex is faster.
var slotIndex = slot?.SequenceIndex ?? -1;


But that broke my script. This was in the CustomMixAndMatch code.

What's the suggested update here?

Thanks!
We're making SpaceChef with Spine. An action filled cooking adventure. We're coming soon to Kickstarter, sign up for our newsletter to be the first to get notified: www.spacechefgame.com. Follow our work on Twitter @BlueGooGames.
User avatar
nicmar
  • Posts: 148

Harald

You are accessing instance Slot instead of SlotData, the latter has the Index property.

In case you didn't already check it out, the replacement lines are listed in the 3.8 to 4.0 upgrade:
Spine-Unity 3.8 to 4.0 Upgrade Guide
SlotData slot = skeletonData.FindSlot(slotName); int index = slot != null ? slot.Index : -1;
User avatar
Harald

Harri
  • Posts: 4459


Return to Unity