mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-24 02:31:24 +08:00
[unity] Fix AnimationReferenceAsset inspector without SkeletonDataAsset.
This commit is contained in:
parent
debc5801c8
commit
d3a38367e1
@ -63,8 +63,15 @@ namespace Spine.Unity.Editor {
|
|||||||
public override void OnInspectorGUI () {
|
public override void OnInspectorGUI () {
|
||||||
animationNameProperty = animationNameProperty ?? serializedObject.FindProperty("animationName");
|
animationNameProperty = animationNameProperty ?? serializedObject.FindProperty("animationName");
|
||||||
string animationName = animationNameProperty.stringValue;
|
string animationName = animationNameProperty.stringValue;
|
||||||
Animation animation = ThisSkeletonDataAsset.GetSkeletonData(true).FindAnimation(animationName);
|
|
||||||
bool animationNotFound = animation == null;
|
Animation animation = null;
|
||||||
|
if (ThisSkeletonDataAsset != null) {
|
||||||
|
var skeletonData = ThisSkeletonDataAsset.GetSkeletonData(true);
|
||||||
|
if (skeletonData != null) {
|
||||||
|
animation = skeletonData.FindAnimation(animationName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool animationNotFound = (animation == null);
|
||||||
|
|
||||||
if (changeNextFrame) {
|
if (changeNextFrame) {
|
||||||
changeNextFrame = false;
|
changeNextFrame = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user