Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetInt

This method is deprecated. Use Material.SetFloat or Material.SetInteger instead.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

SetInt(string, int)

This method is deprecated. Use Material.SetFloat or Material.SetInteger instead.
public void SetInt(string name, int value)

Parameters

name

Property name, e.g. "_SrcBlend".

value

Integer value to set.

Remarks

When setting values on materials using the Standard Shader, you should be aware that you may need to use Material.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 Material.SetFloat that casts the passed value to a float.

SetInt(int, int)

This method is deprecated. Use Material.SetFloat or Material.SetInteger instead.
public void SetInt(int nameID, int value)

Parameters

nameID

Property name ID, use Shader.PropertyToID to get it.

value

Integer value to set.

Remarks

When setting values on materials using the Standard Shader, you should be aware that you may need to use Material.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 Material.SetFloat that casts the passed value to a float.