mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fix MecanimTranslator clearing incompletely.
This commit is contained in:
parent
1c04803b59
commit
97c5293fb1
@ -120,17 +120,25 @@ namespace Spine.Unity {
|
|||||||
readonly List<AnimatorClipInfo> clipInfoCache = new List<AnimatorClipInfo>();
|
readonly List<AnimatorClipInfo> clipInfoCache = new List<AnimatorClipInfo>();
|
||||||
readonly List<AnimatorClipInfo> nextClipInfoCache = new List<AnimatorClipInfo>();
|
readonly List<AnimatorClipInfo> nextClipInfoCache = new List<AnimatorClipInfo>();
|
||||||
#endif
|
#endif
|
||||||
Animator animator;
|
|
||||||
|
|
||||||
|
Animator animator;
|
||||||
public Animator Animator { get { return this.animator; } }
|
public Animator Animator { get { return this.animator; } }
|
||||||
|
|
||||||
public void Initialize (Animator animator, SkeletonDataAsset skeletonDataAsset) {
|
public void Initialize (Animator animator, SkeletonDataAsset skeletonDataAsset) {
|
||||||
this.animator = animator;
|
this.animator = animator;
|
||||||
|
|
||||||
|
previousAnimations.Clear();
|
||||||
|
|
||||||
animationTable.Clear();
|
animationTable.Clear();
|
||||||
clipNameHashCodeTable.Clear();
|
|
||||||
var data = skeletonDataAsset.GetSkeletonData(true);
|
var data = skeletonDataAsset.GetSkeletonData(true);
|
||||||
foreach (var a in data.Animations)
|
foreach (var a in data.Animations)
|
||||||
animationTable.Add(a.Name.GetHashCode(), a);
|
animationTable.Add(a.Name.GetHashCode(), a);
|
||||||
|
|
||||||
|
clipNameHashCodeTable.Clear();
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
clipInfoCache.Clear();
|
||||||
|
nextClipInfoCache.Clear();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Apply (Skeleton skeleton) {
|
public void Apply (Skeleton skeleton) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user