示例#1
0
 private static bool CheckPlacementWithOrrientation(ImageTile existing, ImageTile newTile, Vector2Int dir)
 {
     char[] edge1 = newTile.GetEdge(dir.x, dir.y, newTile.rotation, newTile.flipped);
     char[] edge2 = existing.GetEdge(-dir.x, -dir.y, existing.rotation, existing.flipped);
     for (int i = 0; i < edge1.Length; i++)
     {
         if (edge1[i] != edge2[i])
         {
             return(false);
         }
     }
     return(true);
 }
示例#2
0
 private static bool CheckPlacement(ImageTile existing, ImageTile newTile, Vector2Int dir)
 {
     foreach (ImageTile.Rotation rot in rots)
     {
         foreach (Vector2Int dir2 in dirs)
         {
             foreach (bool fl in flips)
             {
                 char[] edge1 = newTile.GetEdge(dir2.x, dir2.y, rot, fl);
                 if (existing.MatchEdge(edge1, dir.x, dir.y))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }