Shader with texture with alpha and casting shadows

Hi.

I want a shader that renders a texture with alpha into something in which alpha is transparent and doesn’t cast shadows and opaque part of the texture are indeed opaque and cast shadows. I managed to get this next shader but it seems that the whole texture is opaque to the engine.

Shader "Custom/alphawithshadow"{
 	Properties {
 		_Color ("Main Color", Color) = (1,1,1,1)
 		_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
 	}

	SubShader {
		Tags {
			"Queue"="Transparent"
			"IgnoreProjector"="True"
			"RenderType"="Transparent"
			}
		LOD 200 Blend SrcAlpha OneMinusSrcAlpha
		CGPROGRAM #pragma surface surf Lambert addshadow

		    sampler2D _MainTex;
		    fixed4 _Color;
		    struct Input {
		    	float2 uv_MainTex;
		    };
		    
		    void surf (Input IN, inout SurfaceOutput o) {
		    	fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
		    	o.Albedo = c.rgb;
		    	o.Alpha = c.a;
		    }
    	ENDCG

	}

	Fallback "Transparent/VertexLit"
}

The result is:
alt text
alt text

Though the texture is transparent on some part:
alt text

I am not good with shader coding. I just started learning it.

Alpha blended shader do not cast Shadows shadows.
If you want shadows you have to use cutout in your shader.

You may be interested in looking into the build in cutout shader for reference
They can be downloaded here:
https://unity3d.com/get-unity/download/archive