Documentation

Unity Engine

Download Unity

Unity Engine

SetInteger

Sets a named integer value.
Read time 1 minuteLast updated 6 days ago

Definition

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

SetInteger(string, int)

Sets a named integer value.
public void SetInteger(string name, int value)

Parameters

name

Property name, e.g. "_SrcBlend".

value

Integer value to set.

Remarks

When you set values on materials that use the URP Lit shader, you might need to use Material.EnableKeyword to enable shader features that weren't previously in use. For more information, refer to Accessing Materials via Script.

SetInteger(int, int)

Sets a named integer value.
public void SetInteger(int nameID, int value)

Parameters

nameID

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

value

Integer value to set.

Remarks

When you set values on materials that use the URP Lit shader, you might need to use Material.EnableKeyword to enable shader features that weren't previously in use. For more information, refer to Accessing Materials via Script.