@ara It's not a straightforward task unfortunately. You could use SkeletonRenderer.OnPostProcessVertices
to e.g. encode the location data in the unused vertex normals, and access SkeletonRenderer.Skeleton.DrawOrder
to know which vertex corresponds to which attachment. This will however fail if clipping is active and is removing vertices and adding new ones.
If modifying the spine-unity source code is an option, you could also modify the MeshGenerator
code to directly add location information.
A different solution would be to add a second texture atlas layer (like a normal-map) which contains only the black & white gradient. You could do this either by programmatically packing your attachments in the same layout as normal attachment images (with disabled whitespace stripping, or identical transparent areas). Or alternatively you could draw over the atlas image after it has been exported. You then however need to redo or re-arrange parts of the atlas when added attachments changes the packing layout.