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

参数

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

描述

This method is deprecated. Use SetFloat or SetInteger instead.

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. This function is just an alias to SetFloat that casts the passed value to a float.