Harald
The animation is a locomotion animation, it blends between idle, move and run animations.
The problem is in back_skeleton while it is OK in front_skeleton.
public void Initialize(AnimationDefinition[] animations)
{
_animations = animations;
_tracks = new TrackEntry[animations.Length];
for (var i = 0; i < _tracks.Length; i++)
{
var animationDefinition = _animations[i];
foreach (var animationStateTrack in _skeletonAnimations.CurrentSkeletonAnimation.AnimationState.Tracks)
{
if (animationStateTrack != null)
{
animationStateTrack.Alpha = 0;
}
}
_tracks[i] = _skeletonAnimations.SetAnimation
(
animationDefinition.TrackIndex,
animationDefinition.Name,
animationDefinition.IsLoop
);
_tracks[i].MixBlend = MixBlend.Add;
}
}
public void UpdateBlendValue(float value)
{
var n = _animations.Length - 1;
var sum = 0f;
for (var i = 0; i <= n; i++)
{
var t = (float)i / n;
var alpha = Mathf.Clamp01(1 - Mathf.Abs(value - t) * n);
_tracks[i].Alpha = alpha;
sum += alpha;
}
for (var i = 0; i < _tracks.Length; i++)
{
_tracks[i].Alpha = Mathf.Clamp01(_tracks[i].Alpha / sum);
}
_skeletonAnimations.CurrentSkeletonAnimation.skeleton.SetBonesToSetupPose();
}
After pressing Reload button just once, the glitch is resolved completely.