|
@@ -102,6 +102,25 @@ export class MultiMaterial extends Material {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Specifies if any sub-materials of this multi-material use a given texture.
|
|
|
+ * @param texture Defines the texture to check against this multi-material's sub-materials.
|
|
|
+ * @returns A boolean specifying if any sub-material of this multi-material uses the texture.
|
|
|
+ */
|
|
|
+ public hasTexture(texture: BaseTexture): boolean {
|
|
|
+ if (super.hasTexture(texture)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < this.subMaterials.length; i++) {
|
|
|
+ if (this.subMaterials[i]?.hasTexture(texture)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Gets the current class name of the material e.g. "MultiMaterial"
|
|
|
* Mainly use in serialization.
|
|
|
* @returns the class name
|