This commit is contained in:
MrTorex committed 2026-03-01 00:29:25 +03:00
1 parent bca661e132
commit ed0437638b
9 files changed
+3442 -17

No files matched your search

+10 -2
View File
@@ -10,6 +10,7 @@ namespace Code.UI
{
public class Lab6Controller : MonoBehaviour
{
public bool isDop;
public Graph graph;
public Agent agent;
public Transform targetMarker;
@@ -171,8 +172,15 @@ namespace Code.UI
targetPos.y = 0.5f;
targetMarker.position = targetPos;
var path = _useBfs ? graph.GetPathBfs(agent.gameObject, targetMarker.gameObject) : graph.GetPathDfs(agent.gameObject, targetMarker.gameObject);
List<Vertex> path;
if (!isDop)
path = _useBfs
? graph.GetPathBfs(agent.gameObject, targetMarker.gameObject)
: graph.GetPathDfs(agent.gameObject, targetMarker.gameObject);
else
path = graph.GetPathWeights(agent.gameObject, targetMarker.gameObject);
if (path is { Count: > 0 })
{
_currentPath = path;