unity – Create Mesh between gaps of the tiles in unity3d

I am loading two kinds of tiles (Meshes in tiles format) in unity both are placed in the environment correctly but there is a gap between these two tiles. Like the picture belowenter image description here

I want to fill this gap automatically either through scripting or a shader. With Scriptings, here is the algorithm I thinking but its first step taking too much time.

  1. Get Each tile and get the outer edges of the Mesh (it’s getting to much time to calculate with each tiles as there are thousands of tiles)
  2. Then ray cast from the outer edges of the mesh and get intersection point of outer tiles
  3. take vertices and draw the mesh.

I have get stuck in the first steps as it taking so much time to calculate the outer edges of a tile. Maybe there is a solution available in form of a shader that work between gapes of two meshes?