fix modelComp default material bug (#3429)

This commit is contained in:
zxg0622
2018-10-25 18:22:59 +08:00
committed by Huabing.Xu
parent 37041dc704
commit 413ba0a9b7
+6 -4
View File
@@ -172,10 +172,12 @@ export default class ModelComponent extends RenderableComponent {
this._updateReceiveShadow();
/** @type {import("../../../engine/cocos/3d/assets/material").default} */
let mtl = new cc.Material();
mtl.effectAsset = cc.game._builtins['builtin-effect-unlit'];
mtl.setProperty("color", new cc.vmath.color4(0, 0, 0, 1));
this.material = mtl;
if (this.material == null) {
let mtl = new cc.Material();
mtl.effectAsset = cc.game._builtins['builtin-effect-unlit'];
mtl.setProperty("color", new cc.vmath.color4(0, 0, 0, 1));
this.material = mtl;
}
}
onEnable() {