Additional pass in surface shader (enable/disable pass)

Can’t find overview info in docs about this case:

I have surface shader that implements custom Lighting function. After shading I want to render additional semi-transparent pass with custom fragment shader. How to do that?

And one more thing - I want to enable/disable this additional pass from scripts. Looks like tags can be used in this case, but how exactly?

Just write your additional pass after your surface shader code:

Shader {

  SubShader {

    CGPROGRAM
      // Surface shader
    ENDCG

    Pass {
      CGPROGRAM
        // Additional Vert/Frag shader
      ENDCG
    }
  }
}

You can add custom keywords to a shader using the #pragma directive:

#pragma MY_KEYWORD

You can then add conditional code within the shader based on whether the keyword is defined, as:

#ifdef MY_KEYWORD
...
#endif

And you can change the keyword from script, using

Shader.EnableKeyword("MY_KEYWORD");
Shader.DisableKeyword("MY_KEYWORD");

(I’ve never personally tried enabling/disabling an entire pass like this, but I guess it would work).