/// <summary> /// Used to check tiles around a given wall /// </summary> public static void TileCheckEmpty(Vector3Int _pos1, Vector3Int _pos2, int _indexRoom, int _indexWall) { if (DungeonUtility.GetTilemap().GetTile(_pos1) == null && DungeonUtility.GetTilemap().GetTile(_pos2) == null) { TileManager.ChangeTilePiece(m_rooms[_indexRoom].WallPositions[_indexWall], 0, TileType.Wall, DungeonUtility.GetTilemap()); } }
public static void PlaceDoor(int _index) { int randomPosChoice = Random.Range(0, RoomManager.GetAllRooms()[_index].WallPositions.Count); Vector3Int randomWallPos = RoomManager.GetAllRooms()[_index].WallPositions[randomPosChoice]; DungeonUtility.AddDoorPosition(randomWallPos); RoomManager.GetAllRooms()[_index].DoorPositions.Add(randomWallPos); TileManager.ChangeTilePiece(randomWallPos, 0, TileType.Door, DungeonUtility.GetTilemap()); // RoomManager.GetAllRooms()[_index].WallPositions.RemoveAt(randomPosChoice); }
public static void TileCheckNotEmpty(Vector3Int _pos1, Vector3Int _pos2, Vector3Int _pos3, Vector3Int _pos4, int _indexRoom, int _indexWall, string _tileName) { if (DungeonUtility.GetTilemap().GetTile(_pos1) != null && DungeonUtility.GetTilemap().GetTile(_pos2) != null && DungeonUtility.GetTilemap().GetTile(_pos3) != null && DungeonUtility.GetTilemap().GetTile(_pos4) != null) { if (DungeonUtility.GetTilemap().GetTile(_pos1).name == _tileName && DungeonUtility.GetTilemap().GetTile(_pos2).name == _tileName) { TileManager.ChangeTilePiece(m_rooms[_indexRoom].WallPositions[_indexWall], 0, TileType.Floor, DungeonUtility.GetTilemap()); } if (DungeonUtility.GetTilemap().GetTile(_pos3).name == _tileName && DungeonUtility.GetTilemap().GetTile(_pos4).name == _tileName) { TileManager.ChangeTilePiece(m_rooms[_indexRoom].WallPositions[_indexWall], 0, TileType.Floor, DungeonUtility.GetTilemap()); } } }