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

Added DrawLinesBetweenWaypoints method.

This commit is contained in:
Rich Dunne 2020-09-13 03:00:07 -06:00
parent 07dcc46abb
commit 435fce3c15

View file

@ -1,10 +1,9 @@
using Rage; using Rage;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
namespace SceneManager namespace SceneManager
{ {
public class Path public class Path
{ {
private int _number { get; set; } private int _number { get; set; }
@ -20,6 +19,7 @@ namespace SceneManager
{ {
_number = pathNum; _number = pathNum;
_state = pathState; _state = pathState;
DrawLinesBetweenWaypoints();
} }
public void SetPathNumber(int pathNum) public void SetPathNumber(int pathNum)
@ -83,7 +83,33 @@ namespace SceneManager
} }
} }
public void DrawLinesBetweenWaypoints()
{
GameFiber.StartNew(() =>
{
while (SettingsMenu.threeDWaypoints.Checked)
{
if (MenuManager.menuPool.IsAnyMenuOpen())
{
for (int i = 0; i < Waypoints.Count; i++)
{
if (i != Waypoints.Count - 1)
{
if (Waypoints[i + 1].DrivingFlag == VehicleDrivingFlags.StopAtDestination)
{
Debug.DrawLine(Waypoints[i].Position, Waypoints[i + 1].Position, Color.Orange);
}
else
{
Debug.DrawLine(Waypoints[i].Position, Waypoints[i + 1].Position, Color.Green);
}
}
}
}
GameFiber.Yield();
}
});
}
} }