Oceans have been giant empty pits to avoid ever since I went from circle worlds to curved surfaces in the first dev log. Tackling it went way better than I'd feared.
Not one to reinvent the wheel when I have a million wheels I have to invent, I found a Unity Store asset called Water Waves 2D. In this package was a circle water solution.
This asset takes a collision and gives the closest vertex a velocity that it then propagates out across the vertexes neighbors. The velocity is used to calculate a position offset and cause the vertices to rise and fall as the velocity spreads out and springs up and down.
I first added one of these circle wave assets to my worlds, loved how the wave mechanics worked and had a great start. I just needed to fix them up to look better for an ocean and not take up an entire world. It didn't take too long to just cut out a semicircle from the assets custom built mesh solution.
From there I came up with a simple solution where I would take two parameters, an angle that is inside the pool I'm filling and a radius of the water level.
Then I walk from the start angle (orange line) in both directions collecting vertices (purple dots) that are at the bottom of the pool until the height of the vertex was greater than the given radius (green lines). Next I walk along the radius from one edge to the other (white dots). Then I sort the vertices to end up with a clockwise sorted hull of vertices.
I then feed that hull of vertices to an ear clipping algorithm that calculates a shape filling set of triangles. I then color the vertices before finally using all this data to construct a custom mesh.
Then I set up the collisions, added some sound effects, wrote a script to add an upwards force to objects that are submerged and at last the oceans are filled.