mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[Unity] AnimationName warnings
https://github.com/EsotericSoftware/spine-runtimes/issues/444 This makes AnimationName getter and setter safer but still warns the user of unusual circumstances.
This commit is contained in:
parent
5378b7979e
commit
bb7d131c28
@ -72,6 +72,11 @@ public class SkeletonAnimation : SkeletonRenderer, ISkeletonAnimation {
|
||||
|
||||
public String AnimationName {
|
||||
get {
|
||||
if (!valid) {
|
||||
Debug.LogWarning("You tried access AnimationName but the SkeletonAnimation was not valid. Try checking your Skeleton Data for errors.");
|
||||
return null;
|
||||
}
|
||||
|
||||
TrackEntry entry = state.GetCurrent(0);
|
||||
return entry == null ? null : entry.Animation.Name;
|
||||
}
|
||||
@ -79,6 +84,12 @@ public class SkeletonAnimation : SkeletonRenderer, ISkeletonAnimation {
|
||||
if (_animationName == value)
|
||||
return;
|
||||
_animationName = value;
|
||||
|
||||
if (!valid) {
|
||||
Debug.LogWarning("You tried to change AnimationName but the SkeletonAnimation was not valid. Try checking your Skeleton Data for errors.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == null || value.Length == 0)
|
||||
state.ClearTrack(0);
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user