Shader.SetGlobalColor 设置全局颜色

static function SetGlobalColor (propertyName : string, color : Color) : void

Description描述

Sets a global color property for all shaders.

为所有着色器设置一个全局颜色属性。

Global properties are used if a shader needs them but the material does not have them defined (for example, if the shader does not expose them in Properties block).

如果一个着色器需要某个属性,而材质没有定义它们,将使用全局属性(例如,如果着色器不在 Properties模块中暴露它们)。

Usually this is used if you have a set of custom shaders that all use the same "global" color (for example, color of the sun). Then you can set the global property from script and don't have to setup the same color in all materials.

通常在你有一组定义的着色器,所有使用相同的"全局"颜色(例如,太阳的颜色)。然后你可以从脚本中设置全局属性,并不需要在所有材质中设置相同的颜色。

参见:SetGlobalFloat, SetGlobalVector, SetGlobalTexture; Material class

Page last updated: 2011-3-31