Browse Source

[unity] Fix SkeletonAnimator autoreset weight.

pharan 8 năm trước cách đây
mục cha
commit
c1dce1f476
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      spine-unity/Assets/spine-unity/SkeletonAnimator.cs

+ 1 - 1
spine-unity/Assets/spine-unity/SkeletonAnimator.cs

@@ -101,7 +101,7 @@ namespace Spine.Unity {
 				previousAnimations.Clear();
 
 				for (int layer = 0, n = animator.layerCount; layer < n; layer++) {
-					float layerWeight = animator.GetLayerWeight(layer);
+					float layerWeight = (layer == 0) ? 1 : animator.GetLayerWeight(layer);
 					if (layerWeight <= 0) continue;
 
 					AnimatorStateInfo nextStateInfo = animator.GetNextAnimatorStateInfo(layer);