From 1bba1fab87a84be3575b61aad811d8fa1d071b96 Mon Sep 17 00:00:00 2001 From: jerrywwl Date: Wed, 23 Jan 2019 10:50:33 +0800 Subject: [PATCH] npm run build --- cocos/renderer/ui/ui-material.ts | 5 +++++ cocos/renderer/ui/ui.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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; }