Sorry for the late reply!
I'm not sure I understand your question correctly, please let me know if you are having different things in mind.
In Spine after export you will typically not use single PNG images per attachment, instead they will be grouped to an atlas with one or more atlas pages. You can control which images are grouped together on the same atlas page by organizing your images into subfolders: Texture Packing - Spine User Guide: Folder structure.
You may also choose to export multiple separate atlases (e.g. one atlas containing all attachments that are shared between skeletons) using the export workflow described above. Multiple Spine skeletons can share a single atlas asset and use a common attachment. The attachment name in the assigned atlas assets of a SkeletonDataAsset
must match for it to be found. While normally you will have a single atlas asset, with potentially multiple atlas pages (having one Material and one PNG file each), you can also assign multiple SpineAtlasAsset
s at your SkeletonDataAsset
.
Regarding asset bundles:
Every atlas description file (ending with .atlas.txt
) will have a SpineAtlasAsset
(with suffix _Atlas
) generated upon import, holding references to both the Material using the PNG image file (for each atlas page) as well as the .atlas.txt
asset. So when using separate asset bundles, normal rules apply regarding asset references across asset bundle borders. If you need to use separate asset bundles for Spine skeletons A
and B
and have a shared atlas asset shared_Atlas
, then you either need to make sure to not include the shared_Atlas
in any asset bundle but in the main game executable instead, or restore the missing references via scripts manually after loading the bundles.
A different approach, using single Sprite images would be to swap out attachments of a Spine skeleton at runtime with a replacement Sprite via Attachment.GetRemappedClone()
. This is demonstrated in the example scenes Spine Examples/Other Examples/Mix and Match
and Spine Examples/Other Examples/Mix and Match Equip
.