mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[unity] Fixed Atlas asset assignment upon import which did not prioritize an atlas of the same name as the skeleton. Closes #1818.
This commit is contained in:
parent
f365815127
commit
eb3d56c9e8
@ -96,7 +96,8 @@ namespace Spine.Unity.Editor {
|
||||
public void UpdateSkeletonData () {
|
||||
preview.Clear();
|
||||
InitializeEditor();
|
||||
EditorUtility.SetDirty(targetSkeletonDataAsset);
|
||||
if (targetSkeletonDataAsset)
|
||||
EditorUtility.SetDirty(targetSkeletonDataAsset);
|
||||
}
|
||||
|
||||
void InitializeEditor () {
|
||||
|
||||
@ -324,9 +324,13 @@ namespace Spine.Unity.Editor {
|
||||
#if SPINE_TK2D
|
||||
IngestSpineProject(loadedAsset, null);
|
||||
#else
|
||||
string skeletonName = Path.GetFileNameWithoutExtension(skeletonPath);
|
||||
var atlasesForSkeleton = FindAtlasesAtPath(dir);
|
||||
atlasesForSkeleton.AddRange(newAtlases);
|
||||
atlasesForSkeleton = atlasesForSkeleton.Union(newAtlases).ToList();
|
||||
var requiredPaths = GetRequiredAtlasRegions(skeletonPath);
|
||||
atlasesForSkeleton.Sort((a, b) => (
|
||||
string.CompareOrdinal(b.name, skeletonName)
|
||||
- string.CompareOrdinal(a.name, skeletonName)));
|
||||
var atlasMatch = GetMatchingAtlas(requiredPaths, atlasesForSkeleton);
|
||||
if (atlasMatch != null || requiredPaths.Count == 0) {
|
||||
IngestSpineProject(loadedAsset, atlasMatch);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user