Offset detail texture in c#

Trying to make an “animated” gui health bar. I have a material whose shader I have set up as Diffuse Detail. (I don’t know much about materials. It was the only shader I could find that suited my needs.) In code, I offset the material to create an animated effect (I’ve done this on non GUI materials in my game and it worked just fine)

    float x = Time.time;
	float y = Time.time / 2;
	mightyFire.mainTextureOffset = new Vector2 (x, y); 

the only problem is it’s changing the main texture, which doesn’t do anything, and I need to change the offset of the DETAIL texture. I can’t find a way to do this in the Unity Manual.

Use this function:

‘_Detail’ will be your property name:

 renderer.material.SetTextureOffset("_Detail", new Vector2(x, y));