Version: 2017.1
public void SetInt (string name, int value);
public void SetInt (int nameID, int value);


nameID 属性名称 ID,使用 Shader.PropertyToID 获取。
value 要设置的整数值。
name 属性名称,例如“_SrcBlend”。



When setting values on materials using the Standard Shader, you should be aware that you may need to use EnableKeyword to enable features of the shader that were not previously in use. For more detail, read Accessing Materials via Script.

此函数只是 SetFloat 的别名,后者将传递的值转换为浮点数。