private void DrawMakLineData(VertexHelper vh, MarkLineData data, AnimationStyle animation, Serie serie,
                              GridCoord grid, Color32 serieColor, Vector3 sp, Vector3 ep)
 {
     if (!animation.IsFinish())
     {
         ep = Vector3.Lerp(sp, ep, animation.GetCurrDetail());
     }
     data.runtimeCurrentEndPosition = ep;
     if (sp != Vector3.zero || ep != Vector3.zero)
     {
         m_RefreshLabel = true;
         chart.ClampInChart(ref sp);
         chart.ClampInChart(ref ep);
         var theme     = chart.theme.axis;
         var lineColor = ChartHelper.IsClearColor(data.lineStyle.color) ? serieColor : data.lineStyle.color;
         var lineWidth = data.lineStyle.width == 0 ? theme.lineWidth : data.lineStyle.width;
         ChartDrawer.DrawLineStyle(vh, data.lineStyle, sp, ep, lineWidth, LineStyle.Type.Dashed, lineColor, lineColor);
         if (data.startSymbol != null && data.startSymbol.show)
         {
             DrawMarkLineSymbol(vh, data.startSymbol, serie, grid, chart.theme, sp, sp, lineColor);
         }
         if (data.endSymbol != null && data.endSymbol.show)
         {
             DrawMarkLineSymbol(vh, data.endSymbol, serie, grid, chart.theme, ep, sp, lineColor);
         }
     }
 }
예제 #2
0
        public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip)
        {
            if (animation.context.type == AnimationType.AlongPath)
            {
                var dist = Vector3.Distance(lp, cp);
                var rate = (dist - animation.context.currentPathDistance + animation.GetCurrDetail()) / dist;
                ip = Vector3.Lerp(lp, cp, rate);
                return(true);
            }
            else
            {
                var startPos = isY ? new Vector3(-10000, progress) : new Vector3(progress, -10000);
                var endPos   = isY ? new Vector3(10000, progress) : new Vector3(progress, 10000);

                return(UGLHelper.GetIntersection(lp, cp, startPos, endPos, ref ip));
            }
        }
예제 #3
0
 public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType)
 {
     animation.context.type = animation.type == AnimationType.Default ?
                              defaultType :
                              animation.type;
 }