Add image mask to shader

Hello there!
I’m actually inspecting some Unity shaders, and this one from AngryBots it’s quite interesting. Nevermind, there’s an option in the shader to add Reflectivity, and I’m wondering how can I add a 2D image in black and white to act as a mask of that effect, but I have no idea on how to implement it.

// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

// Upgrade NOTE: commented out 'float4 unity_LightmapST', a built-in variable
// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable
// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D


one of the most common shader in AngryBots

same as ReflectiveBackgroundPlanarGeometry but falls back
to a simpler lightmap-apply-only shader.

as this shader is used for arbitrary geometry, it is biasing the
normal a little towards the viewer to create a less dramatic specular


Shader "AngryBots/ReflectiveBackgroundArbitraryGeometry" {
Properties {
	_MainTex ("Base", 2D) = "white" {}
	_Normal("Normal", 2D) = "bump" {}
	_Cube("Cube", CUBE) = "black" {}
	_OneMinusReflectivity("OneMinusReflectivity", Range(0.0, 1.0)) = 0.05


struct v2f 
	half4 pos : SV_POSITION;
	half4 uv : TEXCOORD0;

struct v2f_full
	half4 pos : SV_POSITION;
	half4 uv : TEXCOORD0;
	half3 tsBase0 : TEXCOORD2;
	half3 tsBase1 : TEXCOORD3;
	half3 tsBase2 : TEXCOORD4;	
	half3 viewDir : TEXCOORD5;
#include "UnityCG.cginc"		

sampler2D _MainTex;
sampler2D _Normal;		
samplerCUBE _Cube;

half _OneMinusReflectivity;

SubShader {
	Tags { "RenderType"="Opaque" }
	LOD 300 
	Pass {
		#include "AngryInclude.cginc"
		// float4 unity_LightmapST;
		// sampler2D unity_Lightmap;	
		float4 _MainTex_ST;
		v2f_full vert (appdata_full v) 
			v2f_full o;
			o.pos = UnityObjectToClipPos (v.vertex);
			o.uv.xy = TRANSFORM_TEX(v.texcoord,_MainTex);
			#ifdef LIGHTMAP_ON = v.texcoord1.xy * unity_LightmapST.xy +;
			#else = half2(0,0);
			o.viewDir = normalize(WorldSpaceViewDir(v.vertex));
			WriteTangentSpaceData(v, o.tsBase0,o.tsBase1,o.tsBase2);
			return o; 
		fixed4 frag (v2f_full i) : COLOR0 
			half3 nrml = UnpackNormal(tex2D(_Normal, i.uv.xy));
			half3 bumpedNormal = (half3(dot(i.tsBase0,nrml), dot(i.tsBase1,nrml), dot(i.tsBase2,nrml)));
			bumpedNormal = (bumpedNormal + * 0.5;			
			fixed4 tex = tex2D (_MainTex, i.uv.xy);			
			half3 reflectVector = reflect(,;
			fixed4 reflection = texCUBE (_Cube, reflectVector);
			tex += reflection * saturate(tex.a - _OneMinusReflectivity);
			#ifdef LIGHTMAP_ON
				fixed3 lm =  DecodeLightmap (UNITY_SAMPLE_TEX2D(unity_Lightmap,;
				tex.rgb *= lm;
				tex.rgb *= 0.75;
			return tex;
		#pragma vertex vert
		#pragma fragment frag
		#pragma fragmentoption ARB_precision_hint_fastest 
		#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON

FallBack "AngryBots/Fallback"

Do you guys have any idea?
Thanks in advance

Nevermind, figured it out, just adding:

_Mask ("Culling Mask", 2D) = "white" {}