Skip to content

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_nametypedescription
namestringThe name of the property.

Return

typedescription
Texture|nullWhether 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)