add additional debug to WorldRenderer.DrawUnitPath so we can see waypoint density, etc

This commit is contained in:
Chris Forbes
2010-06-23 17:15:18 +12:00
committed by Paul Chote
parent 7d717592c7
commit e56339897f

View File

@@ -235,6 +235,10 @@ namespace OpenRA.Graphics
} }
if (Game.Settings.PathDebug) if (Game.Settings.PathDebug)
DrawUnitPath(selectedUnit);
}
void DrawUnitPath(Actor selectedUnit)
{ {
var mobile = selectedUnit.traits.WithInterface<IMove>().FirstOrDefault(); var mobile = selectedUnit.traits.WithInterface<IMove>().FirstOrDefault();
if (mobile != null) if (mobile != null)
@@ -242,14 +246,19 @@ namespace OpenRA.Graphics
var path = mobile.GetCurrentPath(selectedUnit); var path = mobile.GetCurrentPath(selectedUnit);
var start = selectedUnit.CenterLocation; var start = selectedUnit.CenterLocation;
var c = Color.Green;
foreach (var step in path) foreach (var step in path)
{ {
lineRenderer.DrawLine(start, step, Color.Red, Color.Red); lineRenderer.DrawLine(step + new float2(-1, -1), step + new float2(-1, 1), c, c);
lineRenderer.DrawLine(step + new float2(-1, 1), step + new float2(1, 1), c, c);
lineRenderer.DrawLine(step + new float2(1, 1), step + new float2(1, -1), c, c);
lineRenderer.DrawLine(step + new float2(1, -1), step + new float2(-1, -1), c, c);
lineRenderer.DrawLine(start, step, c, c);
start = step; start = step;
} }
} }
} }
}
void DrawHealthBar(Actor selectedUnit, float2 xy, float2 Xy) void DrawHealthBar(Actor selectedUnit, float2 xy, float2 Xy)
{ {