You need to modify the shader to add color support. Something like:
Shader "Infinity Code/Online Maps/Tileset With Overlay"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
_OverlayBackTex("Overlay Back Texture", 2D) = "black" {}
_OverlayBackAlpha("Overlay Back Alpha", Range(0, 1)) = 1
_TrafficTex("Traffic Texture", 2D) = "black" {}
_OverlayFrontTex("Overlay Front Texture", 2D) = "black" {}
_OverlayFrontAlpha("Overlay Front Alpha", Range(0, 1)) = 1
_OverlayTex("Overlay Texture", 2D) = "black" {}
_OverlayColor("Overlay Color", Color) = (1,1,1,1)
_OverlayAlpha("Overlay Alpha", Range(0, 1)) = 1
_OverlayTL("Overlay Top Left", Vector) = (0, 0, 0, 0)
_OverlayBR("Overlay Bottom Right", Vector) = (1, 1, 0, 0)
}
SubShader
{
Tags {"Queue"="AlphaTest-300" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 200
CGPROGRAM
#pragma surface surf Lambert alphatest:_Cutoff
sampler2D _MainTex;
sampler2D _OverlayBackTex;
half _OverlayBackAlpha;
sampler2D _TrafficTex;
sampler2D _OverlayFrontTex;
half _OverlayFrontAlpha;
fixed4 _Color;
sampler2D _OverlayTex;
fixed4 _OverlayColor;
half _OverlayAlpha;
float4 _OverlayTL;
float4 _OverlayBR;
struct Input
{
float2 uv_MainTex;
float2 uv_OverlayBackTex;
float2 uv_TrafficTex;
float2 uv_OverlayFrontTex;
float3 worldPos;
};
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
fixed4 t = tex2D(_OverlayBackTex, IN.uv_OverlayBackTex);
fixed3 ct = lerp(c.rgb, t.rgb, t.a * _OverlayBackAlpha);
t = tex2D(_TrafficTex, IN.uv_TrafficTex);
ct = lerp(ct, t.rgb, t.a);
t = tex2D(_OverlayFrontTex, IN.uv_OverlayFrontTex);
ct = lerp(ct, t.rgb, t.a * _OverlayFrontAlpha);
ct = ct * _Color;
o.Albedo = ct;
o.Alpha = c.a * _Color.a;
float3 wp = IN.worldPos;
float uvx = (wp.x - _OverlayTL.x) / (_OverlayBR.x - _OverlayTL.x);
float uvy = (wp.z - _OverlayBR.z) / (_OverlayTL.z - _OverlayBR.z);
if (uvx >= 0 && uvx <= 1 && uvy >= 0 && uvy <= 1)
{
t = tex2D(_OverlayTex, float2(uvx, uvy));
fixed3 ct2 = lerp(t.rgb, _OverlayColor.rgb, _OverlayColor.a);
o.Albedo = lerp(ct, ct2, t.a * _OverlayAlpha);
}
}
ENDCG
}
Fallback "Transparent/Cutout/Diffuse"
}
P.S. I haven't tested this change in the shader, but it's very likely to work.
Kind Regards,
Infinity Code Team.
Boost your productivity a lot and immediately using
Ultimate Editor Enhancer.
Trial and non-commerce versions available.