add additional debug to WorldRenderer.DrawUnitPath so we can see waypoint density, etc
This commit is contained in:
@@ -235,18 +235,27 @@ namespace OpenRA.Graphics
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Game.Settings.PathDebug)
|
if (Game.Settings.PathDebug)
|
||||||
{
|
DrawUnitPath(selectedUnit);
|
||||||
var mobile = selectedUnit.traits.WithInterface<IMove>().FirstOrDefault();
|
}
|
||||||
if (mobile != null)
|
|
||||||
{
|
|
||||||
var path = mobile.GetCurrentPath(selectedUnit);
|
|
||||||
var start = selectedUnit.CenterLocation;
|
|
||||||
|
|
||||||
foreach (var step in path)
|
void DrawUnitPath(Actor selectedUnit)
|
||||||
{
|
{
|
||||||
lineRenderer.DrawLine(start, step, Color.Red, Color.Red);
|
var mobile = selectedUnit.traits.WithInterface<IMove>().FirstOrDefault();
|
||||||
start = step;
|
if (mobile != null)
|
||||||
}
|
{
|
||||||
|
var path = mobile.GetCurrentPath(selectedUnit);
|
||||||
|
var start = selectedUnit.CenterLocation;
|
||||||
|
|
||||||
|
var c = Color.Green;
|
||||||
|
|
||||||
|
foreach (var step in path)
|
||||||
|
{
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user