Is there a shader in Unity that prevents transparent parts from overlapping?

In my game, I use cube primitives in part of the 3D interface. They are transparent, and I use the “Transparent/Diffuse” shader. When two of these parts overlap, though, you can see their edges. When many are used in one thing, it is possible to see the edges through one another, illustrated below. Are there any shaders in Unity that could make each colored portion look like a solid part? If not, could one be feasibly

alt textwritten?

You need to set the shader to write to the depth buffer:

ZWrite On