unity create material script code example
Example 1: create material at runtime unity
Material mat = new Material(Shader.Find("Specular"));
Example 2: new material unity
Material mat = public Material(Shader shader);
Material mat = public Material(Material materialToCopy);