Hi there!
I'm currently trying to move to the end of an animation as soon as it starts. I found this post and have tried out the instructions in there, however I am seeing a very brief flicker of the animation in between:
Fast forward an animation to near the end?
Here's the code I'm using:
void MoveToEnd() {
TrackEntry trackEntry = _spineAnimationState.SetAnimation(0, GetEquipmentStateAnimation(EquipmentState.Lowered,
EquipmentState.Raised), false);
trackEntry.mixDuration = 0;
trackEntry.TrackTime = trackEntry.Animation.Duration;
UpdateSkin(_activeEquipment);
}
void UpdateSkin(params EquipmentDataBase[] equipmentData) {
Color baseColor = _baseSlot.GetColor(true);
_loadoutSkin = _loadoutSkin ?? new Skin("Loadout");
_loadoutSkin.Clear();
foreach (EquipmentDataBase equipment in equipmentData) {
if (equipment == null) { continue; }
_loadoutSkin.Append(_spineSkeleton.Data.FindSkin(equipment.AnimationName));
}
_spineSkeleton.SetSkin(_loadoutSkin);
_spineSkeleton.SetSlotsToSetupPose();
_spineAnimationState.Apply(_spineSkeleton);
SetColor(baseColor, 0);
}