- Düzenlendi
[Unity] Binding of Isaac-style stacked images
Hi folks,
I have a desire to attach multiple possibly overlapping images to my Spine skeleton, a la Binding of Isaac, e.g. all this stuff:
I guess slots aren't really the right choice for this, as they have a 1-to-1 attachment relationship. So what's a good solution? Attach them to the bone I want to follow using SpineUtilityBone and worry about z-order problems later?
Thanks!
Yea pretty much unless you want to add slots at runtime; which would save you a lot of drawcalls. I'll probably write an example of how to manage that process a little easier sooner or later.
Either dynamically add slots (note if a draw order timeline is applied, it will overwrite a draw order list you have set), or create the slots before hand so you can control draw order, or put them on top via SkeletonUtility if you don't need to control draw order.
Yeah, I figured adding slots would mess with draw order changes in animations, so that might be tricky to manage.
Good to know that adding slots is completely possible though, I might look into that too. Thanks!
Is there a reason you cant add them as slots?
You could add them as slots, then make them invisible in the set up pose. Then have a 1 frame animation which turns on/off the visibility of the item. This could get messy if you have hundreds of items on a character though.
Having them as slots defined in Spine is tricky for workflow reasons, I feel like. It seems like overloading the purpose of slots as defined in Spine, and would make working in the editor more problematic. But I suppose it's totally possible.
I would also like to be able to add new items without diving into the Spine editor.
Using them as slots isn't so bad - especially if you have a maximum fixed amount of them which is usually the case (at least for me)
Hi,
In case anyone is interested I added functions to spine-c to add bones and slots on fly, get attachments by name, and set attachments from other skins here:
https://github.com/Darky-Lucera/spine-r ... 82e7327703
Added functions:
- Skeleton: spSkeleton_addBone, spSkeleton_addSlot, spSkeleton_getAttachmentByName, spSkeleton_setAttachment2, spSkeleton_setAttachmentFromSkin
- Skin: spSkin_getAttachment2
Thanks for sharing
You are welcome!
Nice, thanks for that. I'll definitely look at doing something similar in C#.