Ejemplo n.º 1
0
    public void GenerateMazeWithNewPuzzles()
    {
        int currentLevelIndex = Math.Min(currentLevel, levels.Count - 1);
        var currentLevelData  = levels[currentLevelIndex];
        var availablePuzzles  = new List <PuzzleData>(currentLevelData.Puzzles);
        var puzzlesToAdd      = GetRandomPuzzles(puzzlesPerLevel, availablePuzzles, SolvedPuzzles);
        var rooms             = AddPuzzlesToMaze(puzzlesToAdd);
        var quadrants         = new List <Vector2Int>(currentLevelData.Quadrants);

        mazeController.GenerateMaze(currentLevelData.MazeWidth, currentLevelData.MazeHeight, rooms, quadrants);
    }
Ejemplo n.º 2
0
 private void Update()
 {
     if (Input.GetKeyDown(key))
     {
         mazeController.GenerateMaze();
     }
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        mazeControllerGameObject.transform.localScale = new Vector3(
            mazeWidth / 10f,
            1,
            mazeHeight / 10f
            );

        mazeController = mazeControllerGameObject.GetComponent <MazeController>();
        mazeController.GenerateMaze(mazeWidth, mazeHeight);
    }