Unlit alpha shader with an extra highlighting color

I have a standard unlit alpha shader that I am using that looks like this.

Shader "Unlit/Game Piece"
{
    Properties
    {
        _Color ("Color Tint", Color) = (1,1,1,1)
        _MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
    }
    Category
    {
        Lighting Off
        ZWrite Off
        Cull back
        Blend SrcAlpha OneMinusSrcAlpha
        Tags {"Queue"="Transparent"}
        SubShader
        {
            Pass
            {
                SetTexture [_MainTex]
                {
                    ConstantColor [_Color]
                    Combine Texture * constant
                }
            }
        }
    }
}

When a game piece that is drawn with this shader is selected I want it to be highlighted. For that, I would like essentially a layer of white (or any color) applied on top of the image (only where the image is non-transparent) with an additive/screen blending mode to make it brighter. Ideally, I would like it to pulse, so it should be possible to adjust the amount of visibility of the highlight color through a script.

So, I thought about adding a _HiColor definition to the properties section for the highlight color, but I have no idea how I would apply it to the image because I am not sure how a second blend mode would be implemented in a shader like this.

Can someone please tell me what I’d have to do to achieve this? I can’t seem to find any info on this.

It is easy.
First. Add “_HiColor” property to your shader.
Second. Add another “SetTexture” command.

Shader "Unlit/Game Piece"
{
    Properties
    {
        _Color("Color Tint", Color) = (1,1,1,1)
        _HiColor("Hi Color Tint", Color) = (1,1,1,1)
        _MainTex("Base (RGB) Alpha (A)", 2D) = "white"
    }
    Category
    {
        Lighting Off
        ZWrite Off
        Cull back
        Blend SrcAlpha OneMinusSrcAlpha
        Tags{ "Queue" = "Transparent" }
        SubShader
        {
            Pass
            {
                SetTexture[_MainTex]
                {
                    ConstantColor[_Color]
                    Combine Texture * constant
                }

                SetTexture[_MainTex]
                {
                    ConstantColor[_HiColor]
                    Combine previous + constant
                }
            }
        }
    }
}

Thanks for the info, but you’re not changing the blend mode between the SetTextures, but I’ll have to give it a try.

I actually solved the problem myself after a bit of mulling and ended up with this shader. It has two passes, which I’m not too sure about, performance-wise, but it works. Here it is.

Shader "Unlit/Game Piece"
{
    Properties
    {
        _Color ("Color Tint", Color) = (1,1,1,1)
        _SpecColor ("Highlight Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
    }
    Category
    {
        Lighting Off
        ZWrite Off
        Cull back
        Tags {"Queue"="Transparent"}
        SubShader
        {
            Pass
            {
                Blend SrcAlpha OneMinusSrcAlpha
                SetTexture [_MainTex]
                {
                    ConstantColor [_Color]
                    Combine Texture * constant
                }
            }

            Pass
            {
                Blend SrcAlpha One
                SetTexture [_MainTex]
                {
                    ConstantColor [_SpecColor]
                    Combine Texture * constant
                }
            }
        }
    }
}