mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] SpineEditorUtilities. Skip processing if null atlas.
This commit is contained in:
parent
c0694bf14b
commit
2aa5685c9a
@ -860,8 +860,9 @@ namespace Spine.Unity.Editor {
|
||||
|
||||
// Iterate regions and bake marked.
|
||||
Atlas atlas = atlasAsset.GetAtlas();
|
||||
if (atlas != null) {
|
||||
FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic);
|
||||
List<AtlasRegion> regions = (List<AtlasRegion>)field.GetValue(atlas);
|
||||
var regions = (List<AtlasRegion>)field.GetValue(atlas);
|
||||
string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset);
|
||||
string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath);
|
||||
string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name);
|
||||
@ -881,6 +882,7 @@ namespace Spine.Unity.Editor {
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
protectFromStackGarbageCollection.Remove(atlasAsset);
|
||||
return (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(AtlasAssetBase));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user