diff options
| author | Simon O'Shea <osheas1@wit.edu> | 2023-08-09 11:58:52 -0400 |
|---|---|---|
| committer | Simon O'Shea <osheas1@wit.edu> | 2023-08-09 11:58:52 -0400 |
| commit | cfe85da6d1c5108088f8d3135c1442bcf9ecdf4a (patch) | |
| tree | 3d0a828ff688014a54f4fdca8ea13e5332cef924 /Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs | |
| parent | f65fea3c10efd37daa304a0ae4cdc5fa3bd1dbfc (diff) | |
| parent | 1b8fa5af0ffc10b3f7d5786ad9635a2b0dd69fda (diff) | |
Merge branch 'main' of https://github.com/osheas1atwit/pathfinding-visualizer
Diffstat (limited to 'Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs b/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs index 10d2dc9..d543b06 100644 --- a/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs +++ b/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/nMain.cs @@ -12,6 +12,7 @@ public class nMain : MonoBehaviour public float speed = 3.0f; + int heuristic; int algorithm; bool astarSelected; bool bfsSelected; @@ -167,7 +168,7 @@ public class nMain : MonoBehaviour 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; Debug.Log("GO ANIMATE"); 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); + + } + } |
