Format
typescript
Material.SetVector(name, value)class: Material
Description
Set the Vector value of a material based on the property name.
This method assigns the specified vector value to the material's property.
Parameters
| param_name | type | description |
|---|---|---|
| name | string | The name of the property. |
| value | Vector4 | The Vector value. |
Return
| type | description |
|---|---|
void |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
material.SetVector("_Vector", new Vector4(1, 2, 3, 4));
let _Vec = material.GetVector("_Vector");
Debug.Log("_Vector: ", _Vec);