示例#1
0
 public override void DebugRender(Burntime.Platform.Graphics.RenderTarget target)
 {
     if (position != move)
     {
         path.DebugRender(target, position);
     }
 }
示例#2
0
 public override void DebugRender(Burntime.Platform.Graphics.RenderTarget target)
 {
     if (position != moveTo)
     {
         target.RenderLine(position, moveTo, new PixelColor(255, 0, 0));
     }
 }
示例#3
0
            public void DebugRender(Burntime.Platform.Graphics.RenderTarget target, Vector2f position)
            {
                if (mask == null)
                {
                    return;
                }

                if (reverse)
                {
                    if (!finishedCalculation)
                    {
                        if (lastNode != null)
                        {
                            Node last  = lastNode;
                            Node trace = lastNode.Parent;
                            while (trace != null && trace.Parent != null)
                            {
                                target.RenderLine(ToMapPoint(last.Position), ToMapPoint(trace.Position), new PixelColor(255, 255, 0));

                                last  = trace;
                                trace = trace.Parent;
                            }
                        }
                    }

                    for (int i = 0; i < wayPoints.Count; i++)
                    {
                        if (i > 0)
                        {
                            target.RenderLine(position, wayPoints[i].Position, finishedCalculation ? new PixelColor(255, 0, 255) : new PixelColor(255, 0, 0));
                        }
                        position = wayPoints[i].Position;
                    }
                }
                else
                {
                    if (reversePath != null)
                    {
                        reversePath.DebugRender(target, position);
                    }

                    if (!finishedCalculation)
                    {
                        if (!reverse)
                        {
                            target.RenderLine(nearest, goal, new PixelColor(0, 255, 0));
                        }

                        if (lastNode != null)
                        {
                            Node last  = lastNode;
                            Node trace = lastNode.Parent;
                            while (trace != null && trace.Parent != null)
                            {
                                target.RenderLine(ToMapPoint(last.Position), ToMapPoint(trace.Position), new PixelColor(255, 255, 0));

                                last  = trace;
                                trace = trace.Parent;
                            }
                        }
                    }

                    for (int i = 0; i < wayPoints.Count; i++)
                    {
                        target.RenderLine(position, wayPoints[i].Position, finishedCalculation ? new PixelColor(0, 0, 255) : new PixelColor(255, 0, 0));
                        position = wayPoints[i].Position;
                    }
                }
            }