1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 23:50:29 +01:00

Changed sphere and line colors for debug graphics based on waypoint types

This commit is contained in:
Rich Dunne 2020-08-20 12:17:06 -06:00
parent c48d1ea8ed
commit d8bf8992f0

View file

@ -40,6 +40,35 @@ namespace SceneManager
while (debugGraphics.Checked && path != null && path.Waypoint.Count > 0) while (debugGraphics.Checked && path != null && path.Waypoint.Count > 0)
{ {
for (int i = 0; i < path.Waypoint.Count; i++) for (int i = 0; i < path.Waypoint.Count; i++)
{
DrawSpheresAtWaypoints(path, i);
if (i != path.Waypoint.Count - 1)
{
DrawLinesBetweenWaypoints(path, i);
}
}
GameFiber.Yield();
}
});
}
}
}
}
private static void DrawLinesBetweenWaypoints(Path path, int i)
{
if (path.Waypoint[i+1].DrivingFlag == VehicleDrivingFlags.StopAtDestination)
{
Debug.DrawLine(path.Waypoint[i].WaypointPos, path.Waypoint[i + 1].WaypointPos, Color.Orange);
}
else
{
Debug.DrawLine(path.Waypoint[i].WaypointPos, path.Waypoint[i + 1].WaypointPos, Color.Green);
}
}
private static void DrawSpheresAtWaypoints(Path path, int i)
{ {
if (path.Waypoint[i].Collector) if (path.Waypoint[i].Collector)
{ {
@ -53,18 +82,6 @@ namespace SceneManager
{ {
Debug.DrawSphere(path.Waypoint[i].WaypointPos, 1f, Color.FromArgb(80, Color.Green)); Debug.DrawSphere(path.Waypoint[i].WaypointPos, 1f, Color.FromArgb(80, Color.Green));
} }
if (i != path.Waypoint.Count - 1)
{
Debug.DrawLine(path.Waypoint[i].WaypointPos, path.Waypoint[i + 1].WaypointPos, Color.White);
}
}
GameFiber.Yield();
}
});
}
}
}
} }
private static void SettingsMenu_OnScrollerChange(UIMenu sender, UIMenuScrollerItem scrollerItem, int oldIndex, int newIndex) private static void SettingsMenu_OnScrollerChange(UIMenu sender, UIMenuScrollerItem scrollerItem, int oldIndex, int newIndex)