增加AnimationAddition动画支持

This commit is contained in:
monitor1394
2023-07-11 13:32:50 +08:00
parent 0adc9e71e5
commit f678477c88
39 changed files with 704 additions and 432 deletions

View File

@@ -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)