public virtual void SetData(RoomData.RootObject roomData, DungeonData.RootObject dungeonData) { RoomData = roomData; DungeonData = dungeonData; Width = Random.Range(roomData.MinWidth, roomData.MaxWidth + 1); Height = Random.Range(roomData.MinHeight, roomData.MaxHeight + 1); _treasureAmount = Random.Range(roomData.MinTreasureAmount, roomData.MaxTreasureAmount + 1); _moneyAmount = Random.Range(roomData.MinMoneyAmount, roomData.MaxMoneyAmount + 1); WallDirectionList.Add(Vector2Int.left); WallDirectionList.Add(Vector2Int.right); WallDirectionList.Add(Vector2Int.up); WallDirectionList.Add(Vector2Int.down); }
public override void SetData(RoomData.RootObject roomData, DungeonData.RootObject dungeonData) { RoomData = roomData; DungeonData = dungeonData; Width = Random.Range(roomData.MinWidth, roomData.MaxWidth + 1); if (Width % 2 == 1) { Width += 1; } Height = Random.Range(roomData.MinHeight, roomData.MaxHeight + 1); if (Height % 2 == 1) { Height += 1; } _treasureAmount = Random.Range(roomData.MinTreasureAmount, roomData.MaxTreasureAmount + 1); _moneyAmount = Random.Range(roomData.MinMoneyAmount, roomData.MaxMoneyAmount + 1); WallDirectionList.Add(Vector2Int.left); WallDirectionList.Add(Vector2Int.right); WallDirectionList.Add(Vector2Int.up); WallDirectionList.Add(Vector2Int.down); }