コード例 #1
0
ファイル: RoomGenerator.cs プロジェクト: ndbookout/MadMansion
        void Start()
        {
            connectingDirections = new List<Direction>();
            connectingRooms = new List<RoomSpace>();
            finishedRooms = new List<RoomSpace>();

            //startRoom.connectingDoor = Direction.North;
            currentRoom = startRoom;
            noRoomSpaces = false;
            roomCount = 0;

            ManageRooms();
        }
コード例 #2
0
ファイル: RoomGenerator.cs プロジェクト: ndbookout/MadMansion
        void ManageRooms()
        {
            CreateNewRoom();

            while(!noRoomSpaces)
            {
                if (roomCount == connectingRooms.Count)
                {
                    noRoomSpaces = true;
                    break;
                }

                currentRoom = connectingRooms[roomCount];

                if (finishedRooms.Contains(currentRoom))
                {
                    roomCount++;
                    continue;
                }
                else
                {
                    CreateNewRoom();
                    roomCount++;
                }
            }
        }