Format
typescript
Material.SetColor(name, value)class: Material
Description
Set the Color value of a material based on the property name.
This method assigns the specified color value to the material's property.
Parameters
| param_name | type | description |
|---|---|---|
| name | string | The name of the property. |
| value | Color | The Color value. |
Return
| type | description |
|---|---|
void |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
material.SetColor("_Color",Color.red);
let _Color = material.GetColor("_Color");
Debug.Log("_Color : ",_Color)