ericn

Hi,
I've been testing the spine mix and match flow with the Unity runtime and i'm wondering if it is possible to use already-unity-packed sprites with Option 2 described here (Option 2: Use template attachments in Spine, and generate Attachments from UnityEngine.Sprites in Unity. http://en.esotericsoftware.com/spine-unity-mix-and-match)

Using already-packed sprites would be nice to avoid the Runtime Repacking if possible. I'm imagining a draw order where it draws from the packed atlas for the equipped item, and draws from the main texture for the rest of the character.

A quick test by modifying the Mix and Match Equip example scene does not seem to work - but maybe i'm missing something!

Here's what I did
1. Start with the Mix and Match Equip example scene
2. Create a unity Sprite Atlas asset containing the Spine Examples/SpineSkeletons/spineboy-unity/Equips/ "goggles-normal" "goggles-tactical" "gun-freeze" and "gun-normal"
3. Set the import settings on those sprites to be "Full Rect" and "Read/Write"
4. Uncheck the pre-multiplied alpha flag on the EquipSystemExample script so that it no longer creates temporary textures when calling attachment.GetRemappedClone(...)

If i'm understanding the documentation, this should render the existing sprite but I just see a white polygon when equipping it.

Anyone have thoughts? thanks!
Nemaš dopuštenje za pregledavanje privit(a)ka dodan(og)ih postu.
ericn
  • Postovi: 3

Harald

It looks like you have enabled compression (Normal Quality instead of None) at your Atlas Default Platform settings, topmost of your Inspector screenshots.

See the Important Notes box in section "Runtime Repacking" here:
spine-unity Runtime Documentation: Combining Skins
Please also note that there is a (rather recently added) FAQ section here on the spine-unity documentation pages:
spine-unity Runtime Documentation: FAQ
Avatar
Harald

Harri
  • Postovi: 3992

ericn

Thanks for the thoughts! compression = none is a good catch, but it still renders as a white box when rendering from a sprite atlased asset (see image)

Not sure if this is an expected use case. If it did work, it would be an interesting compromise between using the temporary textures for rendering and a full runtime bake :)
Nemaš dopuštenje za pregledavanje privit(a)ka dodan(og)ih postu.
ericn
  • Postovi: 3

Harald

Please also disable Tight Packing, which is anyway undesired since it may remove transparent parts (whitespace) that your attachments depend on.

You can also find the recommended SpriteAtlas settings here (note it's a different use-case though):
spine-unity Runtime Documentation: Advanced Using Unity SpriteAtlas as Atlas Provider
Avatar
Harald

Harri
  • Postovi: 3992


Natrag na Unity