mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 15:30:09 +00:00
增加Animation的Addition动画支持
This commit is contained in:
@@ -30,18 +30,22 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serieType = serie.GetType();
|
||||
var animationType = AnimationType.LeftToRight;
|
||||
var enableSerieDataAnimation = true;
|
||||
if (serieType.IsDefined(typeof(DefaultAnimationAttribute), false))
|
||||
{
|
||||
animationType = serieType.GetAttribute<DefaultAnimationAttribute>().type;
|
||||
var attribute = serieType.GetAttribute<DefaultAnimationAttribute>();
|
||||
animationType = attribute.type;
|
||||
enableSerieDataAnimation = attribute.enableSerieDataAddedAnimation;
|
||||
}
|
||||
UpdateAnimationType(serie.animation, animationType);
|
||||
UpdateAnimationType(serie.animation, animationType,enableSerieDataAnimation);
|
||||
}
|
||||
|
||||
public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType)
|
||||
public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType, bool enableSerieDataAnimation)
|
||||
{
|
||||
animation.context.type = animation.type == AnimationType.Default ?
|
||||
defaultType :
|
||||
animation.type;
|
||||
animation.context.enableSerieDataAddedAnimation = enableSerieDataAnimation;
|
||||
}
|
||||
|
||||
public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip)
|
||||
|
||||
Reference in New Issue
Block a user