Ejemplo n.º 1
0
 public void Generate()   // maakt de volledige maze
 {
     StopCoroutine(_mazeGen.GenerateMazeAnim());
     _mazeGen.DestroyMaze(_gridGen.MazeParent);
     _playerSpawner.DestroyPlayer();
     _victory = false;
     _gridGen.GenerateGrid(_uihandler.GetWidthInput(), _uihandler.GetHeightInput());
     _camSetter.SetCameraPos(_gridGen.Width, _gridGen.Height);
     _camSetter.SetCameraSize(_gridGen.Width, _gridGen.Height);
     if (_uihandler.GetAnimation())
     {
         _generating = true;
         StartCoroutine(_mazeGen.GenerateMazeAnim());
     }
     else
     {
         _uihandler.SetSpeed(1);
         _generating = false;
         _mazeGen.GenerateMaze();
     }
 }