Material.SetFloat Manual     Reference     Scripting  
Scripting > Runtime Classes > Material
Material.SetFloat

function SetFloat (propertyName : string, value : float) : void

Description

Set a named float value.

function Start () {
// Use the Glossy shader on the material
renderer.material.shader = Shader.Find(" Glossy");
}

function Update () {
// Animate the Shininess value
var shininess = Mathf.PingPong (Time.time, 1.0);
renderer.material.SetFloat( "_Shininess", shininess );
}

See Also: GetFloat, Materials, ShaderLab documentation.