mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 21:40:41 +00:00
优化Animation
This commit is contained in:
@@ -73,7 +73,15 @@ namespace XCharts.Runtime
|
||||
context.pause = false;
|
||||
context.end = false;
|
||||
context.startTime = 0;
|
||||
context.currProgress = 0;
|
||||
context.destProgress = 0;
|
||||
context.totalProgress = 0;
|
||||
context.sizeProgress = 0;
|
||||
context.currPointIndex = 0;
|
||||
context.currPoint = Vector3.zero;
|
||||
context.destPoint = Vector3.zero;
|
||||
context.dataCurrProgress.Clear();
|
||||
context.dataDestProgress.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -84,8 +92,7 @@ namespace XCharts.Runtime
|
||||
public void Start(bool reset = true)
|
||||
{
|
||||
if (!enable) return;
|
||||
if (context.start) return;
|
||||
if (context.pause)
|
||||
if (context.start)
|
||||
{
|
||||
context.pause = false;
|
||||
return;
|
||||
@@ -187,7 +194,9 @@ namespace XCharts.Runtime
|
||||
if (!context.start) return true;
|
||||
if (context.end) return true;
|
||||
if (context.pause) return false;
|
||||
return context.currProgress == context.destProgress;
|
||||
if (!context.init) return false;
|
||||
return m_Reverse ? context.currProgress <= context.destProgress
|
||||
: context.currProgress >= context.destProgress;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,14 +5,14 @@ namespace XCharts.Runtime
|
||||
public class InteractData
|
||||
{
|
||||
private float m_PreviousValue = 0;
|
||||
private float m_CurrentValue = 0;
|
||||
private float m_TargetValue = 0;
|
||||
private Vector3 m_PreviousPosition;
|
||||
private Vector3 m_TargetPosition;
|
||||
private Color32 m_PreviousColor;
|
||||
private Color32 m_TargetColor;
|
||||
private Color32 m_PreviousToColor;
|
||||
private Color32 m_TargetToColor;
|
||||
private float m_CurrentValue = float.NaN;
|
||||
private float m_TargetValue = float.NaN;
|
||||
private Vector3 m_PreviousPosition = Vector3.one;
|
||||
private Vector3 m_TargetPosition = Vector3.one;
|
||||
private Color32 m_PreviousColor = ColorUtil.clearColor32;
|
||||
private Color32 m_TargetColor = ColorUtil.clearColor32;
|
||||
private Color32 m_PreviousToColor = ColorUtil.clearColor32;
|
||||
private Color32 m_TargetToColor = ColorUtil.clearColor32;
|
||||
private float m_UpdateTime = 0;
|
||||
private bool m_UpdateFlag = false;
|
||||
private bool m_ValueEnable = false;
|
||||
|
||||
Reference in New Issue
Block a user