Exemple #1
0
        private void Awake()
        {
            // If case we want to test it.
            if (MazeData.XSize == 0 || MazeData.YSize == 0)
            {
                MazeData.XSize = 5;
                MazeData.YSize = 5;
            }

            ResetValues();
            GameEndPanel.SetActive(false);

            _mazeHolder = new GameObject {
                name = "Maze holder"
            };
            _mazeGenerator = new MazeGenerator();
            _mazeGenerator.GenerateMaze(MazeData.XSize, MazeData.YSize);
            GeneratePathfindingGraph();
            VisualizeLabyrinth();

            _secondZombieIsEnabled = false;
            _mummyIsEnabled        = false;
            _coinTimer             = CoinAddingRangeTime;

            AddItemIntoMaze(Player);
            AddItemIntoMaze(Zombie);
        }
Exemple #2
0
        // Use this for initialization
        void Start()
        {
            _pauseMenu.PauseEvent += PauseEvent;
            mazeBTransform         = new GameObject("MazeB").transform;
            if (!_autoGenerate)
            {
                DrawGrid();
                _mazeElements.SetMaze(_mazeB);
                _mazeConstructor.SetMaze(_mazeB);
                return;
            }

            _mazeGenerator = new MazeGenerator();
            _mazeA         = _mazeGenerator.GenerateMaze(MazeSizeX, MazeSizeY, MazeSizeZ);
            _mazeB         = _mazeGenerator.GenerateMaze(MazeSizeX, MazeSizeY, MazeSizeZ);
            mazeATransform = new GameObject("MazeA").transform;
            _drawLab.Draw(_mazeA, mazeATransform);

            DrawMazeMap();
        }