[unity] Fix MecanimTranslator clearing incompletely.

This commit is contained in:
John 2018-01-05 14:11:52 +08:00 committed by GitHub
parent 1c04803b59
commit 97c5293fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,17 +120,25 @@ namespace Spine.Unity {
readonly List<AnimatorClipInfo> clipInfoCache = new List<AnimatorClipInfo>();
readonly List<AnimatorClipInfo> nextClipInfoCache = new List<AnimatorClipInfo>();
#endif
Animator animator;
Animator animator;
public Animator Animator { get { return this.animator; } }
public void Initialize (Animator animator, SkeletonDataAsset skeletonDataAsset) {
this.animator = animator;
previousAnimations.Clear();
animationTable.Clear();
clipNameHashCodeTable.Clear();
var data = skeletonDataAsset.GetSkeletonData(true);
foreach (var a in data.Animations)
animationTable.Add(a.Name.GetHashCode(), a);
clipNameHashCodeTable.Clear();
#if UNITY_2017_1_OR_NEWER
clipInfoCache.Clear();
nextClipInfoCache.Clear();
#endif
}
public void Apply (Skeleton skeleton) {