diff options
| author | Simon O'Shea <osheas1@wit.edu> | 2023-08-08 15:34:02 -0400 |
|---|---|---|
| committer | Simon O'Shea <osheas1@wit.edu> | 2023-08-08 15:34:02 -0400 |
| commit | 239f7ed4c592fc90ad8d6afc9e342a0e8f1694cf (patch) | |
| tree | 5da91f3138a7f1f6cd036e19d9f0a436426443b2 | |
| parent | 98a18e1d4e06bb0f70024c095f3e0f5b0ad69db0 (diff) | |
formatted for logan
hooking buttons up to running algorigthms
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/AStar.cs | 5 | ||||
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/Main.cs | 18 |
2 files changed, 13 insertions, 10 deletions
diff --git a/Pathfinding Visualizer/Assets/Scripts/AStar.cs b/Pathfinding Visualizer/Assets/Scripts/AStar.cs index a31d2c2..5d51e6d 100644 --- a/Pathfinding Visualizer/Assets/Scripts/AStar.cs +++ b/Pathfinding Visualizer/Assets/Scripts/AStar.cs @@ -18,9 +18,8 @@ public class AStar : MonoBehaviour this.heuristic = heuristic; } - void Start() + public void go() { - - } + } } diff --git a/Pathfinding Visualizer/Assets/Scripts/Main.cs b/Pathfinding Visualizer/Assets/Scripts/Main.cs index 40f47f1..6ebb37f 100644 --- a/Pathfinding Visualizer/Assets/Scripts/Main.cs +++ b/Pathfinding Visualizer/Assets/Scripts/Main.cs @@ -12,6 +12,9 @@ public class Main : MonoBehaviour int placementValue; + bool astarSelected; + + // Start is called before the first frame update void Start() { @@ -85,12 +88,6 @@ public class Main : MonoBehaviour } - public void StartAStar() - { - AStar astar = new AStar(world, 0); - } - - public void SetModeObstacle() { placementValue = 1; @@ -108,6 +105,13 @@ public class Main : MonoBehaviour world.reset(); } - + public void StartAlgorithm() + { + if(astarSelected) + { + AStar astar = new AStar(world, 0); + astar.go(); + } + } } |
