diff --git a/Runtime/Component/Animation/AnimationInfo.cs b/Runtime/Component/Animation/AnimationInfo.cs
index 37ad59c2..6903eaf5 100644
--- a/Runtime/Component/Animation/AnimationInfo.cs
+++ b/Runtime/Component/Animation/AnimationInfo.cs
@@ -404,6 +404,16 @@ namespace XCharts.Runtime
{
}
+ ///
+ /// Data hiding animation.
+ /// |数据隐藏动画。
+ ///
+ [Since("v3.8.0")]
+ [System.Serializable]
+ public class AnimationHiding : AnimationInfo
+ {
+ }
+
///
/// Interactive animation of charts.
/// |交互动画。
diff --git a/Runtime/Component/Animation/AnimationStyle.cs b/Runtime/Component/Animation/AnimationStyle.cs
index c6ebb68b..3e13a6e8 100644
--- a/Runtime/Component/Animation/AnimationStyle.cs
+++ b/Runtime/Component/Animation/AnimationStyle.cs
@@ -60,6 +60,7 @@ namespace XCharts.Runtime
[SerializeField][Since("v3.8.0")] private AnimationFadeOut m_FadeOut = new AnimationFadeOut() { reverse = true };
[SerializeField][Since("v3.8.0")] private AnimationChange m_Change = new AnimationChange() { duration = 500 };
[SerializeField][Since("v3.8.0")] private AnimationAddition m_Addition = new AnimationAddition() { duration = 500 };
+ [SerializeField][Since("v3.8.0")] private AnimationHiding m_Hiding = new AnimationHiding() { duration = 500 };
[SerializeField][Since("v3.8.0")] private AnimationInteraction m_Interaction = new AnimationInteraction() { duration = 250 };
[Obsolete("Use animation.fadeIn.delayFunction instead.", true)]
@@ -117,6 +118,12 @@ namespace XCharts.Runtime
///
public AnimationAddition addition { get { return m_Addition; } }
///
+ /// Data hiding animation configuration.
+ /// |数据隐藏动画配置。
+ ///
+ ///
+ public AnimationHiding hiding { get { return m_Hiding; } }
+ ///
/// Interaction animation configuration.
/// |交互动画配置。
///
@@ -135,6 +142,7 @@ namespace XCharts.Runtime
m_Animations.Add(m_FadeOut);
m_Animations.Add(m_Change);
m_Animations.Add(m_Addition);
+ m_Animations.Add(m_Hiding);
}
return m_Animations;
}
@@ -560,5 +568,11 @@ namespace XCharts.Runtime
{
return enable && m_FadeOut.context.start;
}
+
+ public bool CanCheckInteract()
+ {
+ return enable && interaction.enable
+ && !IsFadeIn() && !IsFadeOut();
+ }
}
}
\ No newline at end of file
diff --git a/Runtime/Component/Interaction/InteractData.cs b/Runtime/Component/Interaction/InteractData.cs
index f1d25197..b403b7d2 100644
--- a/Runtime/Component/Interaction/InteractData.cs
+++ b/Runtime/Component/Interaction/InteractData.cs
@@ -52,6 +52,19 @@ namespace XCharts.Runtime
}
}
+ public void SetValue(float value)
+ {
+ if (m_TargetValue != value)
+ {
+ if (!m_ValueEnable)
+ m_PreviousValue = value;
+ else
+ m_PreviousValue = m_CurrentValue;
+ UpdateStart();
+ m_TargetValue = value;
+ }
+ }
+
public void SetPosition(ref bool needInteract, Vector3 pos)
{
if (m_TargetPosition != pos)