mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
增加AnimationReset()重置初始化动画接口
This commit is contained in:
@@ -831,6 +831,17 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置初始动画
|
||||
/// </summary>
|
||||
public void AnimationReset()
|
||||
{
|
||||
foreach (var serie in m_Series)
|
||||
{
|
||||
if (serie.animation.enable) serie.animation.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从json中解析数据
|
||||
/// </summary>
|
||||
|
||||
@@ -100,6 +100,12 @@ namespace XCharts
|
||||
m_IsEnd = true;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Stop();
|
||||
Start();
|
||||
}
|
||||
|
||||
public void InitProgress(int data, float curr, float dest)
|
||||
{
|
||||
if (!m_Inited && !m_IsEnd)
|
||||
|
||||
@@ -451,5 +451,16 @@ namespace XCharts
|
||||
m_CheckAnimation = false;
|
||||
m_Series.AnimationStop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset animation to play.
|
||||
/// 重置初始动画,重新播放。
|
||||
/// </summary>
|
||||
public void AnimationReset()
|
||||
{
|
||||
m_CheckAnimation = false;
|
||||
m_Series.AnimationReset();
|
||||
RefreshChart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ namespace XCharts
|
||||
{
|
||||
float duration = serie.animation.duration > 0 ? (float)serie.animation.duration / 1000 : 1;
|
||||
float speed = totalDetailProgress / duration;
|
||||
Debug.LogError("speed:"+speed);
|
||||
float symbolSpeed = serie.symbol.size / duration;
|
||||
serie.animation.CheckProgress(Time.deltaTime * speed);
|
||||
serie.animation.CheckSymbol(Time.deltaTime * symbolSpeed, serie.symbol.size);
|
||||
|
||||
Reference in New Issue
Block a user