Beispiel #1
0
 private static void CreateCornerWalls(TilemapVisualizer tilemapVisualizer, HashSet <Vector2Int> cornerWallPositions, HashSet <Vector2Int> floorPositions)
 {
     foreach (var position in cornerWallPositions)
     {
         string neighboursBinaryType = "";
         foreach (var direction in Direction2D.eightDirectionsList)
         {
             var neighbourPosition = position + direction;
             if (floorPositions.Contains(neighbourPosition))
             {
                 neighboursBinaryType += "1";
             }
             else
             {
                 neighboursBinaryType += "0";
             }
         }
         tilemapVisualizer.PaintSingleCornerWall(position, neighboursBinaryType);
     }
 }
Beispiel #2
0
 private static void CreateCornerWalls(TilemapVisualizer tilemapVisualizer, HashSet <Vector2Int> basicWallPositions, HashSet <Vector2Int> floorPositions)
 {
     foreach (var pos in basicWallPositions)
     {
         string neighboursBinaryType = "";
         foreach (var direction in Direction2D.eightDirectionList)                           // check all eight direction around the wall
         {
             var neighbourPosition = pos + direction;
             if (floorPositions.Contains(neighbourPosition))                                                 // save the neighbour positions in binary
             {
                 neighboursBinaryType += "1";
             }
             else
             {
                 neighboursBinaryType += "0";
             }
         }
         Debug.Log(neighboursBinaryType);
         tilemapVisualizer.PaintSingleCornerWall(pos, neighboursBinaryType);
     }
 }