diff --git a/cocos/renderer/ui/ui-material.ts b/cocos/renderer/ui/ui-material.ts index 1dee43b2da..c9e64ad757 100644 --- a/cocos/renderer/ui/ui-material.ts +++ b/cocos/renderer/ui/ui-material.ts @@ -34,6 +34,11 @@ export class UIMaterial { } public initialize (info: IUIMaterialInfo): boolean { + + if (!this._material) { + return false; + } + this._material = info.material; this._pass = this._material.passes[0]; diff --git a/cocos/renderer/ui/ui.ts b/cocos/renderer/ui/ui.ts index 8138aaf811..aec3f9b854 100644 --- a/cocos/renderer/ui/ui.ts +++ b/cocos/renderer/ui/ui.ts @@ -106,7 +106,7 @@ export class UI { // material.setProperty('mainTexture', texture); material.update(); - this._uiMaterial = this.createUIMaterial( { material }); + // this._uiMaterial = this.createUIMaterial( { material }); return true; }