From 267cb7472c53a73687aa3df5dbb3a1c4da52d07e Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 24 Aug 2023 08:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96`DataZoom`=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E6=96=B0=E5=A2=9E=E5=8A=A8=E7=94=BB=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Component/Animation/AnimationInfoContext.cs | 2 ++ Runtime/Component/Animation/AnimationStyle.cs | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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)