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 /Pathfinding Visualizer/Assets/Scripts/Main.cs | |
| parent | 98a18e1d4e06bb0f70024c095f3e0f5b0ad69db0 (diff) | |
formatted for logan
hooking buttons up to running algorigthms
Diffstat (limited to 'Pathfinding Visualizer/Assets/Scripts/Main.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/Main.cs | 18 |
1 files changed, 11 insertions, 7 deletions
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(); + } + } } |
