shader not working in unity 2017

hi all,
i am trying to use this billboard shader from wikibooks - ive seen it used and working on a youtube tutorial (using unity 5x), but i cant get it to work.

i create a new surface shader, delete the code that is there and paste in the code from wikibooks, compile, and then try to add it to a material.

the first issue is that all the shader is tagged “cg shader for billboards” in the codes first line, it only shows up in the shader drop down menu as its file name ‘new surface shader’ under the custom tab.
secondly and most importantly - it doesnt work - ive applied it to a material but nothing -
in the youtube video its clear that is does work…
i dont know whether some of the code has changed in the upgrade from 5x to 2017 but can someone help please?

the youtube link is:

and the code is :

Shader "Cg  shader for billboards" {
   Properties {
      _MainTex ("Texture Image", 2D) = "white" {}
      _ScaleX ("Scale X", Float) = 1.0
      _ScaleY ("Scale Y", Float) = 1.0
   }
   SubShader {
      Pass {  
         CGPROGRAM
         #pragma vertex vert 
         #pragma fragment frag

         // User-specified uniforms           
         uniform sampler2D _MainTex;       
         uniform float _ScaleX;
         uniform float _ScaleY;

         struct vertexInput {
            float4 vertex : POSITION;
            float4 tex : TEXCOORD0;
         };
         struct vertexOutput {
            float4 pos : SV_POSITION;
            float4 tex : TEXCOORD0;
         };
         vertexOutput vert(vertexInput input)
         {
            vertexOutput output;

            output.pos = mul(UNITY_MATRIX_P,
              mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0))
              + float4(input.vertex.x, input.vertex.y, 0.0, 0.0)
              * float4(_ScaleX, _ScaleY, 1.0, 1.0));
            output.tex = input.tex;

            return output;
         }
         float4 frag(vertexOutput input) : COLOR
         {
            return tex2D(_MainTex, float2(input.tex.xy));  
         }
         ENDCG
      }
   }
}

thanks all

paul uk

works here…

if the shader displays that "new surface shader’ name, it means its not saved or compiled,
that happens with visual studio sometimes (even if press save, it wont), close the shader in vs and save, then it works.

hi, thanks… but im using monodevelop - i realise now why none of the custom shaders ive been trying have not worked - none of them have saved or compiled at all - they just compile as new surface shader - thats probably also why they dont show up in the shader drop down list with their tag name - just the file name they were created with. im not sure why this is happening ? i paste the code into the empty shader , hit the compile button on monodevelop, but it seems its not changing the code at all?
any ideas - this is very frustrating as i need some custom shaders to work?
thanks for your help

paul uk

hi, thanks but i solved it - in monodevelop, you dont click build, you just ‘save’, and then back in unity it updates - i havent seen that anywhere, saying how to do that!