Enable sprite depth write.

I’m using the new Unity 2D sprite functionality, it seems that in doing so, none of the sprites write any values to the zbuffer. Is there a simple way to enable zwrite?

Additionally, is there any way to find the source for say the shader behind the Sprites-Default shader?

I figured this out by downloading the built-in shaders from http://download.unity3d.com/download_unity/builtin_shaders-4.3.0.zip making a duplicate of sprites-default.shader called sprites-zwrite. And within the shader changing the lines:

"RenderType"="Transparent"

and

ZWrite Off

to

"RenderType"="TransparentCutout"

and

ZWrite On

Then using that new shader in all of my sprites.