diff --git a/Runtime/Component/Animation/AnimationInfoContext.cs b/Runtime/Component/Animation/AnimationInfoContext.cs index 34032d5c..b524e63e 100644 --- a/Runtime/Component/Animation/AnimationInfoContext.cs +++ b/Runtime/Component/Animation/AnimationInfoContext.cs @@ -17,6 +17,8 @@ namespace XCharts.Runtime public float sizeProgress; public int currPointIndex; public int destPointIndex; + public Vector3 currPoint; + public Vector3 destPoint; public Dictionary dataCurrProgress = new Dictionary(); public Dictionary dataDestProgress = new Dictionary(); } diff --git a/Runtime/Component/Animation/AnimationStyle.cs b/Runtime/Component/Animation/AnimationStyle.cs index 3e13a6e8..dbe3d2cd 100644 --- a/Runtime/Component/Animation/AnimationStyle.cs +++ b/Runtime/Component/Animation/AnimationStyle.cs @@ -284,7 +284,11 @@ namespace XCharts.Runtime { if (paths.Count < 1) return; var anim = activedAnimation; - if (anim == null) return; + if (anim == null) + { + m_Addition.context.currPointIndex = paths.Count - 1; + return; + } var isAddedAnim = anim is AnimationAddition; var startIndex = 0; if (isAddedAnim) @@ -300,6 +304,12 @@ namespace XCharts.Runtime } var sp = paths[startIndex]; var ep = paths[paths.Count - 1]; + if (sp == anim.context.currPoint && ep == anim.context.destPoint) + { + return; + } + anim.context.currPoint = sp; + anim.context.destPoint = ep; var currDetailProgress = isY ? sp.y : sp.x; var totalDetailProgress = isY ? ep.y : ep.x; if (context.type == AnimationType.AlongPath)