You'll know that each Texture Packer output is a (set of) .png
and .atlas.txt
This corresponds to each resolution you typed there.
On import, Spine-Unity will generate a Spine.Unity.AtlasAsset
for each .atlas.txt
.
So you will have one AtlasAsset per resolution.
Spine-Unity will also have one SkeletonDataAsset per .json
(or .skel.bytes
if you use binary). SkeletonDataAsset also holds a reference to an AtlasAsset it intends to use for loading.
So you need to use the AtlasAsset of the appropriate reolution on the SkeletonDataAsset, and have it load that.
//SkeletonDataAsset mySkeletonDataAsset;
//AtlasAsset myAtlasAssetResolution;
mySkeletonDataAsset.atlasAsset[0] = myAtlasAssetResolution; // set SkeletonDataAsset's source atlas.
mySkeletonDataAsset.Clear(); // Clear if it was previously loaded so it loads from the newly assigned AtlasAsset
mySkeletonDataAsset.GetSkeletonData(false); // Optional. Create new deserialized skeleton data from the current sources.
// If you have any instantiated skeletons using this SkeletonDataAsset
mySkeletonAnimation.Initialize(true); // Initialize(true) is an overwiting initialize. it discards old internal data and creates a fresh state from the SkeletonDataAsset.