|
@@ -228,7 +228,7 @@ namespace Spine.Unity {
|
|
return false;
|
|
return false;
|
|
|
|
|
|
var time = AnimationTime(stateInfo.normalizedTime, info.clip.length,
|
|
var time = AnimationTime(stateInfo.normalizedTime, info.clip.length,
|
|
- info.clip.isLooping, stateInfo.speed < 0);
|
|
|
|
|
|
+ info.clip.isLooping);
|
|
weight = useClipWeight1 ? layerWeight : weight;
|
|
weight = useClipWeight1 ? layerWeight : weight;
|
|
clip.Apply(skeleton, 0, time, info.clip.isLooping, null,
|
|
clip.Apply(skeleton, 0, time, info.clip.isLooping, null,
|
|
weight, layerBlendMode, MixDirection.In);
|
|
weight, layerBlendMode, MixDirection.In);
|
|
@@ -252,7 +252,7 @@ namespace Spine.Unity {
|
|
return false;
|
|
return false;
|
|
|
|
|
|
var time = AnimationTime(stateInfo.normalizedTime + interruptingClipTimeAddition,
|
|
var time = AnimationTime(stateInfo.normalizedTime + interruptingClipTimeAddition,
|
|
- info.clip.length, stateInfo.speed < 0);
|
|
|
|
|
|
+ info.clip.length);
|
|
weight = useClipWeight1 ? layerWeight : weight;
|
|
weight = useClipWeight1 ? layerWeight : weight;
|
|
clip.Apply(skeleton, 0, time, info.clip.isLooping, null,
|
|
clip.Apply(skeleton, 0, time, info.clip.isLooping, null,
|
|
weight, layerBlendMode, MixDirection.In);
|
|
weight, layerBlendMode, MixDirection.In);
|
|
@@ -462,21 +462,20 @@ namespace Spine.Unity {
|
|
}
|
|
}
|
|
animation = GetAnimation(clip);
|
|
animation = GetAnimation(clip);
|
|
float time = AnimationTime(stateInfo.normalizedTime, clip.length,
|
|
float time = AnimationTime(stateInfo.normalizedTime, clip.length,
|
|
- clip.isLooping, stateInfo.speed < 0);
|
|
|
|
|
|
+ clip.isLooping);
|
|
return new KeyValuePair<Animation, float>(animation, time);
|
|
return new KeyValuePair<Animation, float>(animation, time);
|
|
}
|
|
}
|
|
|
|
|
|
- static float AnimationTime (float normalizedTime, float clipLength, bool loop, bool reversed) {
|
|
|
|
- float time = AnimationTime(normalizedTime, clipLength, reversed);
|
|
|
|
|
|
+ static float AnimationTime (float normalizedTime, float clipLength, bool loop) {
|
|
|
|
+ float time = AnimationTime(normalizedTime, clipLength);
|
|
if (loop) return time;
|
|
if (loop) return time;
|
|
const float EndSnapEpsilon = 1f / 30f; // Workaround for end-duration keys not being applied.
|
|
const float EndSnapEpsilon = 1f / 30f; // Workaround for end-duration keys not being applied.
|
|
return (clipLength - time < EndSnapEpsilon) ? clipLength : time; // return a time snapped to clipLength;
|
|
return (clipLength - time < EndSnapEpsilon) ? clipLength : time; // return a time snapped to clipLength;
|
|
}
|
|
}
|
|
|
|
|
|
- static float AnimationTime (float normalizedTime, float clipLength, bool reversed) {
|
|
|
|
- if (reversed)
|
|
|
|
- normalizedTime = (1 - normalizedTime + (int)normalizedTime) + (int)normalizedTime;
|
|
|
|
-
|
|
|
|
|
|
+ static float AnimationTime (float normalizedTime, float clipLength) {
|
|
|
|
+ if (normalizedTime < 0.0f)
|
|
|
|
+ normalizedTime = (normalizedTime % 1.0f) + 1.0f;
|
|
return normalizedTime * clipLength;
|
|
return normalizedTime * clipLength;
|
|
}
|
|
}
|
|
|
|
|