Example #1
0
    void SolveMaze()
    {
        if (!mazeGenerated)
        {
            GenerateMaze();
        }

        graphView.ClearNodes(mazeGraph.mazeNodesList);
        mazeGraph.startNode = mazeGenerator.tiles[4, 4].tileNode;
        mazeGraph.goalNode  = mazeGenerator.tiles[MAZE_WIDTH - 4, MAZE_LENGTH - 4].tileNode;

        graphView.ColorStartNode(mazeGraph.startNode);
        graphView.ColorGoalNode(mazeGraph.goalNode);
        mazePathfinder.Solve(mazeGraph);
    }