Format
typescript
Material.GetTexture(name)class: Material
Description
Get the Texture value of a specified property name.
This method allows you to retrieve the value of a specific texture property of a material, such as diffuse texture, normal map, mask texture, etc.
Parameters
| param_name | type | description |
|---|---|---|
| name | string | The name of the property. |
Return
| type | description |
|---|---|
Texture|null | Whether the Texture value is obtained and the obtained Texture value. |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
let _Tex = material.GetTexture("_Tex");
Debug.Log("_Tex : ",_Tex)