コード例 #1
0
ファイル: GenerateMaze.cs プロジェクト: sarahrothberg/WWW
 private void GenMaze()
 {
     if (maze.IsGenerated())
     {
         UnDrawMaze();
         maze.DeleteMaze();
     }
     maze.SetRoomCreating(CreateRooms);
     maze.SetRoomParams(RoomCount, RoomWidth, RoomHeight);
     maze.SetMazeDepth(1);
     maze.SetUseSeed(UseSeed);
     maze.SetSeedForRandom(MazeSeed);
     maze.SetStartPosition(startPos);
     maze.GenerateNewMaze(MazeWidth, MazeHeight);
     DrawMaze();
 }
コード例 #2
0
ファイル: GenerateMaze.cs プロジェクト: sarahrothberg/WWW
    void Start()
    {
        roomCells    = new List <Vector3[]>();
        wallPosArray = new List <Vector3>();
        endWallPos   = new List <Vector3>();
        startWallPos = new List <Vector3>();
        mazeWalls    = new List <GameObject>();

        maze = new MazeSkeleton(new Vector3(0, 0, 0), MazeWidth, MazeHeight, TunnelWidth, WallWidth, 1, UseSeed, MazeSeed, IsCreateMazeOnStart, CreateRooms, RoomCount, RoomHeight, RoomHeight);
        maze.SetRoomCreating(CreateRooms);
        maze.SetRoomParams(RoomCount, RoomWidth, RoomHeight);
        maze.SetMazeDepth(1);
        if (IsCreateMazeOnStart)
        {
            DrawMaze();
        }
        else
        {
            maze.GenerateNewMaze(MazeWidth, MazeHeight);
            DrawMaze();
        }
    }