Format
typescript
Material.GetFloat(name, out_result)class: Material
Description
Get the Float value of a specific float property of the current material based on the property name.
This method allows you to retrieve the value of a float property of the 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. |
| out_result | number |
Return
| type | description |
|---|---|
number|undefined | Whether the Float value is obtained and the obtained Float value. |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
let _Float = material.GetFloat("_Float");
Debug.Log("_Float : ",_Float)