Documentation

Unity Engine


User Manual

Script Reference

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.
Read time 1 minuteLast updated 4 days ago

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.