Ejemplo n.º 1
0
        private void Start()
        {
            grid = new MapGrid(width, length);
            gridVisualizer.VisualizeGrid(width, length);
            MapHelper.RandomlyChooseAndSetStartAndExit(grid, ref startPosition, ref exitPosition, randomPlacement, startEdge, exitEdge);
            CandidateMap map = new CandidateMap(grid, numberOfPieces);

            map.CreateMap(startPosition, exitPosition);
            mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), false);
        }
        public void GenerateNewMap()
        {
            mapVisualizer.ClearMap();

            grid = new MapGrid(width, length);

            MapHelper.RandomlyChooseAndSetStartAndExit(grid, ref startPosition, ref exitPosition, randomPlacement, startEdge, exitEdge);

            map = new CandidateMap(grid, numberOfPieces);
            map.CreateMap(startPosition, exitPosition, autoRepair);
            mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), visualizeUsingPrefabs);
        }