mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[unity] Fixed Timeline and AnimationReferenceAsset in general not updating animations after skeleton asset updated. Closes #1915.
This commit is contained in:
parent
b3f76c4e54
commit
52ecc9349c
@ -472,6 +472,7 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorPrefs.SetString(guid + "_hash", currentHash);
|
EditorPrefs.SetString(guid + "_hash", currentHash);
|
||||||
}
|
}
|
||||||
SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(skeletonDataAsset);
|
SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(skeletonDataAsset);
|
||||||
|
SpineEditorUtilities.DataReloadHandler.ReloadAnimationReferenceAssets(skeletonDataAsset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,6 +128,18 @@ namespace Spine.Unity.Editor {
|
|||||||
if (sg.isActiveAndEnabled && sg.skeletonDataAsset == skeletonDataAsset) sg.Initialize(true);
|
if (sg.isActiveAndEnabled && sg.skeletonDataAsset == skeletonDataAsset) sg.Initialize(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ReloadAnimationReferenceAssets (SkeletonDataAsset skeletonDataAsset) {
|
||||||
|
string[] guids = UnityEditor.AssetDatabase.FindAssets("t:AnimationReferenceAsset");
|
||||||
|
foreach (string guid in guids) {
|
||||||
|
string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
|
||||||
|
if (!string.IsNullOrEmpty(path)) {
|
||||||
|
var referenceAsset = UnityEditor.AssetDatabase.LoadAssetAtPath<AnimationReferenceAsset>(path);
|
||||||
|
if (referenceAsset.SkeletonDataAsset == skeletonDataAsset)
|
||||||
|
referenceAsset.Initialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user