Merge branch 'main' of https://github.com/osheas1atwit/pathfinding-visualizer
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ public class nMain : MonoBehaviour
|
|||||||
|
|
||||||
public float speed = 3.0f;
|
public float speed = 3.0f;
|
||||||
|
|
||||||
|
int heuristic;
|
||||||
int algorithm;
|
int algorithm;
|
||||||
bool astarSelected;
|
bool astarSelected;
|
||||||
bool bfsSelected;
|
bool bfsSelected;
|
||||||
@@ -167,7 +168,7 @@ public class nMain : MonoBehaviour
|
|||||||
|
|
||||||
if (true)
|
if (true)
|
||||||
{
|
{
|
||||||
Pathfinder path = new Pathfinder(world, agent, obstacles, samples, 0, 0);
|
Pathfinder path = new Pathfinder(world, agent, obstacles, samples, algorithm, heuristic);
|
||||||
Stack<Node> result = path.result;
|
Stack<Node> result = path.result;
|
||||||
Debug.Log("GO ANIMATE");
|
Debug.Log("GO ANIMATE");
|
||||||
cellMesh.Animate(result);
|
cellMesh.Animate(result);
|
||||||
@@ -207,4 +208,26 @@ public class nMain : MonoBehaviour
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void h0Toggle(bool tickOn)
|
||||||
|
{
|
||||||
|
|
||||||
|
heuristic = 0;
|
||||||
|
Debug.Log(heuristic);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void h1Toggle(bool tickOn)
|
||||||
|
{
|
||||||
|
heuristic = 1;
|
||||||
|
Debug.Log(heuristic);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void h2Toggle(bool tickOn)
|
||||||
|
{
|
||||||
|
|
||||||
|
heuristic = 2;
|
||||||
|
Debug.Log(heuristic);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user