Set shader values in script for all instances of shader?

If I have multiple instances of an object using a shader, is there a way to set a parameter of the shader for all instances of them at once? I’m trying to sync the time value the shader uses to the time in my game and I can’t tell if _Time[1] is the same as any of the time values from the Time class. So I figured I’d just call SetFloat with Time.time, but I don’t wan to have to do that for every instance of the object using that shader.

I threw together a very crude example… and please read the code carefully as it contains two solutions:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class UnityAnswersHelp : MonoBehaviour
{

    public Shader MyShader;
    public List<Material> AllShaders = new List<Material>();

	// Use this for initialization
	void Start ()
	{
	    Shader.SetGlobalFloat("Whatever", 1f); //If you have a custom value associated. This will set ALL shaders that have the matching value of 'Whatever'...

	    foreach (Material m in GameObject.FindObjectsOfType<Material>())
	    {
	        if (m.shader.name == MyShader.name)
	        {
	            AllShaders.Add(m);
	        }
	    }

	    foreach (Material b in AllShaders)
	    {
	        b.SetFloat("Whatever", 1f);
	    }
	}
}

Keep in mind, with Shader.SetGlobalFloat, it’ll set the value for ALL shaders, and it’s not specific to a specific style of shader.

So if you did Shader.SetGlobalFloat(“Brightness”, 1f);, it’ll set EVERY single shader that has the option of “Brightness”.