文档

Unity Engine

Unity Engine

SetGlobalInt

Adds a command to set the value of a given property for all Shaders, where the property has a type of Int in ShaderLab code.
阅读时间1 分钟最后更新于 1 个月前

Definition

SetGlobalInt(int, int)

Adds a command to set the value of a given property for all Shaders, where the property has a type of
Int
in ShaderLab code.
public void SetGlobalInt(int nameID, int value)

Parameters

nameID


value

Remarks

When Unity executes the CommandBuffer, it sets the value of the given property for all Shaders. Internally, the shader property types
Float
and
Int
are treated exactly the same; therefore, this function is an alias to CommandBuffer.SetGlobalFloat.
For properties that use the ShaderLab type
Integer
, which are internally represented as integers, use CommandBuffer.SetGlobalInteger.

SetGlobalInt(string, int)

Adds a command to set the value of a given property for all Shaders, where the property has a type of
Int
in ShaderLab code.
public void SetGlobalInt(string name, int value)

Parameters

name


value

Remarks

When Unity executes the CommandBuffer, it sets the value of the given property for all Shaders. Internally, the shader property types
Float
and
Int
are treated exactly the same; therefore, this function is an alias to CommandBuffer.SetGlobalFloat.
For properties that use the ShaderLab type
Integer
, which are internally represented as integers, use CommandBuffer.SetGlobalInteger.