Format
typescript
Material.GetVector(name)class: Material
Description
Get the Vector value of a material based on the property name.
This method allows you to retrieve the value of a specific vector property of a material. It is important to ensure that the property name passed in is correct, otherwise it will return the default value.
Parameters
| param_name | type | description |
|---|---|---|
| name | string | The name of the property. |
Return
| type | description |
|---|---|
Vector4|undefined | Whether the Vector value is retrieved successfully and the retrieved Vector value. |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
let _Vec = material.GetVector("_Vec");
Debug.Log("_Vec : ",_Vec)