diff options
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(); + } + } } |
