DoF based on distance to camera's Y position?

The existing DoF(depth of field) effect that comes with unity, works based on the distance to the camera’s position (I think).
I’m working on a 2.5D game, where the camera is slightly rotated, to have a bit more perspective.

Because the camera is slightly rotated, objects that are near the right side of the screen, are much further away from the camera than objects that are near the left side of the screen. Because of this, different parts along the X-axis of the level get blurred differently.(left pic) This is not really the desired result.

What I’m trying to do, is that the DoF effect only looks at an object’s Y position, relative to the camera. (right pic) This way, only things that are closer to, or further away from a certain Y position will get blurred.

I have looked into the existing DoF script and shaders, but I couldn’t make heads or tails of it. It sounds like something that’s easy to do. Any pointers?

I solved it. Not by modifying the shader, but by using a custom projection matrix.