Files
XCharts/Runtime/Component/Animation/AnimationStyle.cs

654 lines
20 KiB
C#
Raw Normal View History

2022-05-22 22:17:38 +08:00
using System;
using System.Collections.Generic;
using UnityEngine;
2022-02-19 22:37:57 +08:00
namespace XCharts.Runtime
{
2021-12-11 18:26:28 +08:00
public enum AnimationType
{
2021-12-12 18:05:26 +08:00
/// <summary>
/// he default. An animation playback mode will be selected according to the actual situation.
2022-03-24 08:37:06 +08:00
/// |默认。内部会根据实际情况选择一种动画播放方式。
2021-12-12 18:05:26 +08:00
/// </summary>
2021-12-11 18:26:28 +08:00
Default,
2021-12-12 18:05:26 +08:00
/// <summary>
/// Play the animation from left to right.
2022-03-24 08:37:06 +08:00
/// |从左往右播放动画。
2021-12-12 18:05:26 +08:00
/// </summary>
2021-12-11 18:26:28 +08:00
LeftToRight,
2021-12-12 18:05:26 +08:00
/// <summary>
/// Play the animation from bottom to top.
2022-03-24 08:37:06 +08:00
/// |从下往上播放动画。
2021-12-12 18:05:26 +08:00
/// </summary>
2021-12-11 18:26:28 +08:00
BottomToTop,
2021-12-12 18:05:26 +08:00
/// <summary>
/// Play animations from the inside out.
2022-03-24 08:37:06 +08:00
/// |由内到外播放动画。
2021-12-12 18:05:26 +08:00
/// </summary>
2021-12-11 18:26:28 +08:00
InsideOut,
2021-12-12 18:05:26 +08:00
/// <summary>
/// Play the animation along the path.
/// |沿着路径播放动画。当折线图从左到右无序或有折返时,可以使用该模式。
2021-12-12 18:05:26 +08:00
/// </summary>
AlongPath,
/// <summary>
/// Play the animation clockwise.
2022-03-24 08:37:06 +08:00
/// |顺时针播放动画。
2021-12-12 18:05:26 +08:00
/// </summary>
2021-12-11 18:26:28 +08:00
Clockwise,
2021-12-12 18:05:26 +08:00
}
2021-12-11 18:26:28 +08:00
2021-12-12 18:05:26 +08:00
public enum AnimationEasing
{
Linear,
2021-12-11 18:26:28 +08:00
}
2021-12-12 18:05:26 +08:00
2023-07-04 13:07:44 +08:00
[Since("v3.8.0")]
[System.Serializable]
public class AnimationInfo
{
[SerializeField][Since("v3.8.0")] private bool m_Enable = true;
[SerializeField][Since("v3.8.0")] private float m_Delay = 0;
[SerializeField][Since("v3.8.0")] private float m_Duration = 1000;
public bool enable { get { return m_Enable; } set { m_Enable = value; } }
public float delay { get { return m_Delay; } set { m_Delay = value; } }
public float duration { get { return m_Duration; } set { m_Duration = value; } }
public Action OnAnimationStart { get; set; }
public Action OnAnimationEnd { get; set; }
public AnimationDelayFunction delayFunction { get; set; }
public AnimationDurationFunction durationFunction { get; set; }
internal bool start { get; set; }
internal bool end { get; set; }
}
[Since("v3.8.0")]
[System.Serializable]
public class AnimationFadeIn : AnimationInfo
{
}
[Since("v3.8.0")]
[System.Serializable]
public class AnimationFadeOut : AnimationInfo
{
}
[Since("v3.8.0")]
[System.Serializable]
public class AnimationUpdated : AnimationInfo
{
}
[Since("v3.8.0")]
[System.Serializable]
public class AnimationAdded : AnimationInfo
{
}
/// <summary>
/// the animation of serie.
2022-03-24 08:37:06 +08:00
/// |动画表现。
/// </summary>
[System.Serializable]
2021-12-11 18:26:28 +08:00
public class AnimationStyle : ChildComponent
{
[SerializeField] private bool m_Enable = true;
2021-12-12 18:05:26 +08:00
[SerializeField] private AnimationType m_Type;
[SerializeField] private AnimationEasing m_Easting;
[SerializeField] private int m_Threshold = 2000;
[SerializeField][Since("v3.4.0")] private bool m_UnscaledTime;
2023-07-04 13:07:44 +08:00
[SerializeField][Since("v3.8.0")] private AnimationFadeIn m_FadeIn = new AnimationFadeIn();
[SerializeField][Since("v3.8.0")] private AnimationFadeOut m_FadeOut = new AnimationFadeOut();
[SerializeField][Since("v3.8.0")] private AnimationUpdated m_Updated = new AnimationUpdated() { duration = 500 };
[SerializeField][Since("v3.8.0")] private AnimationAdded m_Added = new AnimationAdded() { duration = 500 };
[Obsolete("Use animation.fadeIn.delayFunction instead.", true)]
2022-03-04 22:17:32 +08:00
public AnimationDelayFunction fadeInDelayFunction;
2023-07-04 13:07:44 +08:00
[Obsolete("Use animation.fadeIn.durationFunction instead.", true)]
2022-03-04 22:17:32 +08:00
public AnimationDurationFunction fadeInDurationFunction;
2023-07-04 13:07:44 +08:00
[Obsolete("Use animation.fadeOut.delayFunction instead.", true)]
2022-03-04 22:17:32 +08:00
public AnimationDelayFunction fadeOutDelayFunction;
2023-07-04 13:07:44 +08:00
[Obsolete("Use animation.fadeOut.durationFunction instead.", true)]
2022-03-04 22:17:32 +08:00
public AnimationDurationFunction fadeOutDurationFunction;
2023-07-04 13:07:44 +08:00
[Obsolete("Use animation.fadeIn.OnAnimationEnd() instead.", true)]
public Action fadeInFinishCallback { get; set; }
[Obsolete("Use animation.fadeOut.OnAnimationEnd() instead.", true)]
public Action fadeOutFinishCallback { get; set; }
2021-12-12 18:05:26 +08:00
public AnimationStyleContext context = new AnimationStyleContext();
/// <summary>
/// Whether to enable animation.
2022-03-24 08:37:06 +08:00
/// |是否开启动画效果。
/// </summary>
public bool enable { get { return m_Enable; } set { m_Enable = value; } }
/// <summary>
2021-12-12 18:05:26 +08:00
/// The type of animation.
2022-03-24 08:37:06 +08:00
/// |动画类型。
2021-12-12 18:05:26 +08:00
/// </summary>
public AnimationType type { get { return m_Type; } set { m_Type = value; } }
/// <summary>
/// Whether to set graphic number threshold to animation. Animation will be disabled when graphic number is larger than threshold.
2022-03-24 08:37:06 +08:00
/// |是否开启动画的阈值,当单个系列显示的图形数量大于这个阈值时会关闭动画。
/// </summary>
public int threshold { get { return m_Threshold; } set { m_Threshold = value; } }
/// <summary>
2023-07-04 13:07:44 +08:00
/// Animation updates independently of Time.timeScale.
/// |动画是否受TimeScaled的影响。默认为 false 受TimeScaled的影响。
2019-11-30 21:24:04 +08:00
/// </summary>
2023-07-04 13:07:44 +08:00
public bool unscaledTime { get { return m_UnscaledTime; } set { m_UnscaledTime = value; } }
2019-11-30 21:24:04 +08:00
/// <summary>
2023-07-04 13:07:44 +08:00
/// Fade in animation configuration.
/// |渐入动画配置。
2019-11-30 21:24:04 +08:00
/// </summary>
2023-07-04 13:07:44 +08:00
public AnimationFadeIn fadeIn { get { return m_FadeIn; } }
2020-07-17 12:19:21 +08:00
/// <summary>
2023-07-04 13:07:44 +08:00
/// Fade out animation configuration.
/// |渐出动画配置。
/// </summary>
2023-07-04 13:07:44 +08:00
public AnimationFadeOut fadeOut { get { return m_FadeOut; } }
/// <summary>
2023-07-04 13:07:44 +08:00
/// Update data animation configuration.
/// |更新数据动画配置。
2020-07-17 12:19:21 +08:00
/// </summary>
2023-07-04 13:07:44 +08:00
public AnimationUpdated updated { get { return m_Updated; } }
2020-07-17 12:19:21 +08:00
/// <summary>
2023-07-04 13:07:44 +08:00
/// Add data animation configuration.
/// |添加数据动画配置。
2020-07-17 12:19:21 +08:00
/// </summary>
2023-07-04 13:07:44 +08:00
public AnimationAdded added { get { return m_Added; } }
2021-12-12 18:05:26 +08:00
private Dictionary<int, float> m_ItemCurrProgress = new Dictionary<int, float>();
private Dictionary<int, float> m_ItemDestProgress = new Dictionary<int, float>();
private bool m_IsEnd = true;
private bool m_IsPause = false;
private bool m_IsInit = false;
private float startTime { get; set; }
2021-12-12 18:05:26 +08:00
private float m_CurrDetailProgress;
private float m_DestDetailProgress;
private float m_TotalDetailProgress;
private float m_CurrSymbolProgress;
2021-11-23 13:20:07 +08:00
private Vector3 m_LinePathLastPos;
public void FadeIn()
{
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
2021-11-23 13:20:07 +08:00
return;
if (m_IsPause)
{
m_IsPause = false;
return;
}
2021-11-23 13:20:07 +08:00
2023-07-04 13:07:44 +08:00
if (m_FadeIn.start)
2021-11-23 13:20:07 +08:00
return;
startTime = Time.time;
2023-07-04 13:07:44 +08:00
m_FadeIn.start = true;
m_IsEnd = false;
m_IsInit = false;
m_IsPause = false;
2023-07-04 13:07:44 +08:00
m_FadeOut.end = false;
m_CurrDetailProgress = 0;
m_DestDetailProgress = 1;
m_CurrSymbolProgress = 0;
2021-12-12 18:05:26 +08:00
m_ItemCurrProgress.Clear();
m_ItemDestProgress.Clear();
}
public void Restart()
{
Reset();
FadeIn();
}
public void FadeOut()
{
if (m_IsPause)
{
m_IsPause = false;
return;
}
2021-11-23 13:20:07 +08:00
2023-07-04 13:07:44 +08:00
m_FadeOut.start = true;
startTime = Time.time;
2023-07-04 13:07:44 +08:00
m_FadeIn.start = true;
m_IsEnd = false;
m_IsInit = false;
m_IsPause = false;
m_CurrDetailProgress = 0;
m_DestDetailProgress = 1;
m_CurrSymbolProgress = 0;
2021-12-12 18:05:26 +08:00
m_ItemCurrProgress.Clear();
m_ItemDestProgress.Clear();
}
public void Pause()
{
if (!m_IsPause)
{
m_IsPause = true;
}
}
public void Resume()
{
if (m_IsPause)
{
m_IsPause = false;
}
}
private void End()
{
2021-11-23 13:20:07 +08:00
if (m_IsEnd)
return;
m_IsEnd = true;
m_IsInit = false;
2021-11-23 13:20:07 +08:00
2023-07-04 13:07:44 +08:00
if (m_FadeIn.start)
2020-07-17 12:19:21 +08:00
{
2023-07-04 13:07:44 +08:00
m_FadeIn.start = false;
if (m_FadeIn.OnAnimationEnd != null)
2020-07-17 12:19:21 +08:00
{
2023-07-04 13:07:44 +08:00
m_FadeIn.OnAnimationEnd();
2020-07-17 12:19:21 +08:00
}
}
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
{
2023-07-04 13:07:44 +08:00
m_FadeOut.start = false;
m_FadeOut.end = true;
if (m_FadeOut.OnAnimationEnd != null)
2020-07-17 12:19:21 +08:00
{
2023-07-04 13:07:44 +08:00
m_FadeOut.OnAnimationEnd();
2020-07-17 12:19:21 +08:00
}
}
}
public void Reset()
{
2023-07-04 13:07:44 +08:00
m_FadeIn.start = false;
m_IsEnd = true;
m_IsInit = false;
m_IsPause = false;
2023-07-04 13:07:44 +08:00
m_FadeOut.start = false;
m_FadeOut.end = false;
2021-12-12 18:05:26 +08:00
m_ItemCurrProgress.Clear();
}
2021-12-12 18:05:26 +08:00
public void InitProgress(float curr, float dest)
{
2021-11-23 13:20:07 +08:00
if (m_IsInit || m_IsEnd)
return;
m_IsInit = true;
2021-12-08 08:31:32 +08:00
m_TotalDetailProgress = dest - curr;
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
{
m_CurrDetailProgress = dest;
m_DestDetailProgress = curr;
}
else
{
m_CurrDetailProgress = curr;
m_DestDetailProgress = dest;
}
}
2021-12-08 08:31:32 +08:00
public void InitProgress(List<Vector3> paths, bool isY)
{
if (paths.Count < 1) return;
var sp = paths[0];
var ep = paths[paths.Count - 1];
var currDetailProgress = isY ? sp.y : sp.x;
var totalDetailProgress = isY ? ep.y : ep.x;
2021-12-12 18:05:26 +08:00
if (context.type == AnimationType.AlongPath)
2021-12-08 08:31:32 +08:00
{
currDetailProgress = 0;
totalDetailProgress = 0;
var lp = sp;
for (int i = 1; i < paths.Count; i++)
{
var np = paths[i];
totalDetailProgress += Vector3.Distance(np, lp);
lp = np;
}
2021-12-12 18:05:26 +08:00
m_LinePathLastPos = sp;
context.currentPathDistance = 0;
2021-12-08 08:31:32 +08:00
}
2021-12-12 18:05:26 +08:00
InitProgress(currDetailProgress, totalDetailProgress);
}
private void SetDataCurrProgress(int index, float state)
{
2021-12-12 18:05:26 +08:00
m_ItemCurrProgress[index] = state;
}
2021-12-12 18:05:26 +08:00
private float GetDataCurrProgress(int index, float initValue, float destValue, ref bool isBarEnd)
{
2020-08-18 09:29:23 +08:00
if (IsInDelay())
{
isBarEnd = false;
return initValue;
}
2021-12-12 18:05:26 +08:00
var c1 = !m_ItemCurrProgress.ContainsKey(index);
var c2 = !m_ItemDestProgress.ContainsKey(index);
2020-08-19 09:11:23 +08:00
if (c1 || c2)
{
2021-11-23 13:20:07 +08:00
if (c1)
2021-12-12 18:05:26 +08:00
m_ItemCurrProgress.Add(index, initValue);
2021-11-23 13:20:07 +08:00
if (c2)
2021-12-12 18:05:26 +08:00
m_ItemDestProgress.Add(index, destValue);
2021-11-23 13:20:07 +08:00
2020-08-18 09:29:23 +08:00
isBarEnd = false;
}
else
{
2021-12-12 18:05:26 +08:00
isBarEnd = m_ItemCurrProgress[index] == m_ItemDestProgress[index];
}
2021-12-12 18:05:26 +08:00
return m_ItemCurrProgress[index];
}
2020-08-18 09:29:23 +08:00
public bool IsFinish()
{
#if UNITY_EDITOR
2021-11-23 13:20:07 +08:00
if (!Application.isPlaying)
return true;
#endif
2021-12-12 18:05:26 +08:00
if (!m_Enable || m_IsEnd)
return true;
if (IsIndexAnimation())
2022-06-20 08:24:00 +08:00
{
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start) return m_CurrDetailProgress <= m_DestDetailProgress;
2022-06-20 08:24:00 +08:00
else return m_CurrDetailProgress > m_DestDetailProgress;
}
2021-12-12 18:05:26 +08:00
if (IsItemAnimation())
return false;
return true;
}
public bool IsInFadeOut()
{
2023-07-04 13:07:44 +08:00
return m_FadeOut.start;
}
public bool IsInDelay()
{
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
return (m_FadeOut.delay > 0 && Time.time - startTime < m_FadeOut.delay / 1000);
2021-11-23 13:20:07 +08:00
else
2023-07-04 13:07:44 +08:00
return (m_FadeIn.delay > 0 && Time.time - startTime < m_FadeIn.delay / 1000);
}
2021-12-12 18:05:26 +08:00
public bool IsItemAnimation()
{
return context.type == AnimationType.BottomToTop || context.type == AnimationType.InsideOut;
}
public bool IsIndexAnimation()
{
2022-05-22 22:17:38 +08:00
return context.type == AnimationType.LeftToRight ||
context.type == AnimationType.Clockwise ||
context.type == AnimationType.AlongPath;
2021-12-12 18:05:26 +08:00
}
public float GetIndexDelay(int dataIndex)
{
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start && m_FadeOut.delayFunction != null)
return m_FadeOut.delayFunction(dataIndex);
else if (m_FadeIn.start && m_FadeIn.delayFunction != null)
return m_FadeIn.delayFunction(dataIndex);
2021-11-23 13:20:07 +08:00
else
return 0;
}
2021-12-12 18:05:26 +08:00
public bool IsInIndexDelay(int dataIndex)
{
2021-12-12 18:05:26 +08:00
return Time.time - startTime < GetIndexDelay(dataIndex) / 1000f;
}
public bool IsAllOutDelay(int dataCount)
{
var nowTime = Time.time - startTime;
for (int i = 0; i < dataCount; i++)
{
2021-12-12 18:05:26 +08:00
if (nowTime < GetIndexDelay(i) / 1000)
2021-11-23 13:20:07 +08:00
return false;
}
return true;
}
2020-03-08 10:47:48 +08:00
public bool CheckDetailBreak(float detail)
{
2021-12-12 18:05:26 +08:00
if (!IsIndexAnimation())
return false;
return !IsFinish() && detail > m_CurrDetailProgress;
}
public bool CheckDetailBreak(Vector3 pos, bool isYAxis)
{
2021-12-12 18:05:26 +08:00
if (!IsIndexAnimation())
return false;
2021-11-23 13:20:07 +08:00
if (IsFinish())
return false;
2021-12-12 18:05:26 +08:00
if (context.type == AnimationType.AlongPath)
2021-11-23 13:20:07 +08:00
{
2021-12-12 18:05:26 +08:00
context.currentPathDistance += Vector3.Distance(pos, m_LinePathLastPos);
2021-11-23 13:20:07 +08:00
m_LinePathLastPos = pos;
2021-12-12 18:05:26 +08:00
return CheckDetailBreak(context.currentPathDistance);
2021-11-23 13:20:07 +08:00
}
else
{
if (isYAxis)
return pos.y > m_CurrDetailProgress;
else
return pos.x > m_CurrDetailProgress;
}
}
2021-12-12 18:05:26 +08:00
public void CheckProgress()
2021-12-08 08:31:32 +08:00
{
2021-12-12 18:05:26 +08:00
if (IsItemAnimation() && context.isAllItemAnimationEnd)
{
End();
return;
}
2021-12-08 08:31:32 +08:00
CheckProgress(m_TotalDetailProgress);
}
2021-12-12 18:05:26 +08:00
public void CheckProgress(double total)
{
2021-11-23 13:20:07 +08:00
if (IsFinish())
return;
if (!m_IsInit || m_IsPause || m_IsEnd)
return;
if (IsInDelay())
return;
var duration = GetCurrAnimationDuration();
2023-07-04 13:07:44 +08:00
var delta = (float)(total / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime));
if (m_FadeOut.start)
{
m_CurrDetailProgress -= delta;
if (m_CurrDetailProgress <= m_DestDetailProgress)
{
m_CurrDetailProgress = m_DestDetailProgress;
End();
}
}
else
{
m_CurrDetailProgress += delta;
if (m_CurrDetailProgress >= m_DestDetailProgress)
{
m_CurrDetailProgress = m_DestDetailProgress;
End();
}
}
}
internal float GetCurrAnimationDuration(int dataIndex = -1)
{
if (dataIndex >= 0)
{
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start && m_FadeOut.durationFunction != null)
return m_FadeOut.durationFunction(dataIndex) / 1000f;
if (m_FadeIn.start && m_FadeIn.durationFunction != null)
return m_FadeIn.durationFunction(dataIndex) / 1000f;
}
2021-11-23 13:20:07 +08:00
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
return m_FadeOut.delay > 0 ? m_FadeOut.delay / 1000 : 1f;
2021-11-23 13:20:07 +08:00
else
2023-07-04 13:07:44 +08:00
return m_FadeIn.delay > 0 ? m_FadeIn.delay / 1000 : 1f;
}
2022-02-19 17:35:22 +08:00
internal float CheckItemProgress(int dataIndex, float destProgress, ref bool isEnd, float startProgress = 0)
{
2021-12-12 18:05:26 +08:00
isEnd = false;
2023-07-04 13:07:44 +08:00
var initHig = m_FadeOut.start ? destProgress : startProgress;
var destHig = m_FadeOut.start ? startProgress : destProgress;
2021-12-12 18:05:26 +08:00
var currHig = GetDataCurrProgress(dataIndex, initHig, destHig, ref isEnd);
if (isEnd || IsFinish())
{
2023-07-04 13:07:44 +08:00
return m_FadeOut.end ? startProgress : destProgress;
}
2021-12-12 18:05:26 +08:00
else if (IsInDelay() || IsInIndexDelay(dataIndex))
2020-08-19 09:11:23 +08:00
{
2023-07-04 13:07:44 +08:00
return m_FadeOut.start ? destProgress : startProgress;
2020-08-19 09:11:23 +08:00
}
else if (m_IsPause)
{
2020-08-18 09:29:23 +08:00
return currHig;
}
else
{
var duration = GetCurrAnimationDuration(dataIndex);
var delta = (destProgress - startProgress) / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime);
2023-07-04 13:07:44 +08:00
currHig = currHig + (m_FadeOut.start ? -delta : delta);
if (m_FadeOut.start)
{
if ((initHig > 0 && currHig <= 0) || (initHig < 0 && currHig >= 0))
{
currHig = 0;
2021-12-12 18:05:26 +08:00
isEnd = true;
}
}
else
{
2022-05-22 22:17:38 +08:00
if ((destProgress - startProgress > 0 && currHig > destProgress) ||
(destProgress - startProgress < 0 && currHig < destProgress))
{
currHig = destProgress;
isEnd = true;
}
}
SetDataCurrProgress(dataIndex, currHig);
return currHig;
}
}
2022-03-31 21:54:34 +08:00
public void CheckSymbol(float dest)
{
2021-11-23 13:20:07 +08:00
if (!enable || m_IsEnd || m_IsPause || !m_IsInit)
return;
if (IsInDelay())
return;
var duration = GetCurrAnimationDuration();
var delta = dest / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime);
2023-07-04 13:07:44 +08:00
if (m_FadeOut.start)
{
m_CurrSymbolProgress -= delta;
2021-11-23 13:20:07 +08:00
if (m_CurrSymbolProgress < 0)
m_CurrSymbolProgress = 0;
}
else
{
m_CurrSymbolProgress += delta;
2021-11-23 13:20:07 +08:00
if (m_CurrSymbolProgress > dest)
m_CurrSymbolProgress = dest;
}
}
public float GetSysmbolSize(float dest)
{
#if UNITY_EDITOR
2021-11-23 13:20:07 +08:00
if (!Application.isPlaying)
return dest;
#endif
2021-11-23 13:20:07 +08:00
if (!enable)
return dest;
if (m_IsEnd)
2023-07-04 13:07:44 +08:00
return m_FadeOut.start ? 0 : dest;
2021-11-23 13:20:07 +08:00
return m_CurrSymbolProgress;
}
public float GetCurrDetail()
{
2021-11-28 20:31:41 +08:00
#if UNITY_EDITOR
if (!Application.isPlaying)
return m_DestDetailProgress;
#endif
return m_CurrDetailProgress;
}
public float GetCurrRate()
{
#if UNITY_EDITOR
2021-11-23 13:20:07 +08:00
if (!Application.isPlaying)
return 1;
#endif
2021-11-23 13:20:07 +08:00
if (!enable || m_IsEnd)
return 1;
return m_CurrDetailProgress;
}
public int GetCurrIndex()
{
#if UNITY_EDITOR
2021-11-23 13:20:07 +08:00
if (!Application.isPlaying)
return -1;
#endif
2021-11-23 13:20:07 +08:00
if (!enable || m_IsEnd)
return -1;
2023-07-04 13:07:44 +08:00
return (int)m_CurrDetailProgress;
}
public float GetDataChangeDuration()
{
if (m_Enable && m_Updated.enable)
return m_Updated.duration;
else
return 0;
}
2023-07-04 13:07:44 +08:00
public float GetDataAddDuration()
2019-11-30 21:24:04 +08:00
{
2023-07-04 13:07:44 +08:00
if (m_Enable && m_Added.enable)
return m_Added.duration;
2021-11-23 13:20:07 +08:00
else
return 0;
2019-11-30 21:24:04 +08:00
}
public bool HasFadeOut()
{
2023-07-04 13:07:44 +08:00
return enable && m_FadeOut.end && m_IsEnd;
}
}
}