Using multiple custom water planes together (Welding multiple planes together)

Okay, so i have a pretty basic script that makes planes have waves on them (I´m using it for a water based game)

function Update () {

var mesh : Mesh = GetComponent.<MeshFilter>().mesh;
var vertices : Vector3[] = mesh.vertices;

for (var i = 0; i < vertices.Length; i++)
{
vertices<em>.y += Mathf.Sin(Time.time * speed+ baseHeight<em>.x + baseHeight<em>.y) * (scale*.5) + Mathf.Sin(Time.time * speed+ baseHeight<em>.z + baseHeight_.y) * (scale*.5);_</em></em></em></em>

}

GetComponent.().sharedMesh = mesh;
mesh.vertices = vertices;
mesh.RecalculateBounds();

}
The problem is that the plane has a limited size. I can put two planes next to each other but their waves will not connect.
[84980-unity-5-two-planes.png|84980]
What would be the best way to connect multiple plane vertices together (Or should i just create a custom model and manipulate its vertices)

Answer long overdue but might be nice for someone else finding this.

One solution would be to make a tiling displacement map which you pan for the waves, basically making the waves “loop” so you can have multiple planes next to eachother.