MaterialPropertyBlock.AddFloat Manual     Reference     Scripting  
Scripting > Runtime Classes > MaterialPropertyBlock
MaterialPropertyBlock.AddFloat

function AddFloat (name : string, value : float) : void

function AddFloat (nameID : int, value : float) : void

Description

Add a float material property.

For performance reasons, the property block can contain only a limited number of property values. Two 4x4 matrices, six vectors/colors or 12 floats can be stored in the block. Storage space for the values is shared, so storing one matrix leaves twice less space to store vectors and floats. When block's storage is filled up, additional Add calls will be ignored.

Function variant that takes nameID is faster. If you are adding properties with the same name repeatedly, use Shader.PropertyToID to get unique identifier for the name, and pass the identifier to AddFloat.