Update the material properties of a RawImage doesn't work

I am trying to draw some 2d elements in a panel by applying a material on a RawImage in a panel.
the script is also in this panel.

shader is like:

Shader "Custom/FaceBBox" {
	Properties { 
		_BoxColor("Box Color", Color) = (0.0, 0.0, 0.0, 1.0)
		_Top("Top", float) = 0.0
		_Left("Left", float) = 1.0
		_Right("Right", float) = 0.0
		_Bottom("Bottom",float) = 1.0
		_Brand("Brand",float) = 0.1
		_Width("Display Width",float) = 500
		_Height("Display Height", float) = 500
	}
	SubShader {
        Pass
        {
			Tags { "RenderType"="Opaque" }
			LOD 200


			CGPROGRAM
			#pragma vertex vert
             #pragma fragment frag
			#include "UnityCG.cginc"
			struct v2f 
			{
				float4 pos : SV_POSITION;
				float4 texcoord : TEXCOORD0;
			};
      
			v2f vert (appdata_base v)
			{
				v2f o;
				o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
				o.texcoord = v.texcoord;
				return o;
			}
			
			sampler2D _MainTex;
			float4 _BoxColor;
			float _Top;
			float _Left;
			float _Right;
			float _Bottom;
			float _Brand;
			float _Width;
			float _Height;

			float4 frag (v2f i) : COLOR0 
			{
				float x = i.texcoord.x;
				float y = i.texcoord.y;
	
				float bu = _Height / _Width * _Brand;
				
				clip(
					y < _Top - _Brand * 0.5 ||
					x < _Left - bu * 0.5 ||
					y > _Bottom + _Brand * 0.5 ||
					x > _Right + bu * 0.5
					|| 
					((x > _Left + bu * 0.5 && x < _Right - bu * 0.5)
					&& (y > _Top + _Brand * 0.5 && y < _Bottom - _Brand * 0.5))
					? -1 : 1);
				return _BoxColor;
			} 
			ENDCG
		} 
	}
	FallBack "Diffuse"
}

then i do something like this in script:

public class FaceBoundingBox : MonoBehaviour {

	public Vector2 bMax = new Vector2(0.0f,0.0f), bMin = new Vector2(1.0f,1.0f);
	public Color color = new Color(1.0f, 0.0f, 0.0f, 1.0f);

	private Material material = null;

	// Use this for initialization
	void Start () {
		material = GetComponent<UnityEngine.UI.RawImage>().material;
		
		material.SetColor("Box Color",color);
		material.SetFloat("Top", bMax.y);
		material.SetFloat("Left", bMin.y);
		material.SetFloat("Right", bMin.x);
		material.SetFloat("Bottom", bMax.x);
		material.SetFloat("Display Width", Screen.width);
		material.SetFloat("Display Height", Screen.height);
	}

	// Update is called once per frame
	void Update()
	{
		material.SetColor("Box Color", color);
		material.SetFloat("Top", bMax.y);
		material.SetFloat("Left", bMin.y);
		material.SetFloat("Right", bMin.x);
		material.SetFloat("Bottom", bMax.x);
		material.SetFloat("Display Width", Screen.width);
		material.SetFloat("Display Height", Screen.height);
	}
}

i change the public value of the script in editor, but rendering result is not changed.

click on the object where the script is attached, and check the variable values in the Inspector Panel.

Make sure that both the target gameobject / UI component, and the assigned variables, show correctly.
Otherwise, override them when the Game is NOT playing.
You can do this for numerics by typing in values, or for GameObjects by dragging them from the Heirarchy to the Inspector panel.

The values in the inspector panel override any “default” values set at the top of your code.
This has caused countless hours of frustration for many.