mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
fix modelComp default material bug (#3429)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user