mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-25 11:18:30 +00:00
[engine] 修复某些情况下渲染组件未就绪导致的报错问题
This commit is contained in:
parent
3f8f7ffd34
commit
654d0bd634
@ -69,7 +69,7 @@ export default class Assembler {
|
||||
if (CC_JSB) comp.node._inJsbDirtyList = false;
|
||||
// setMaterial 中会置 comp._texIdDirty = true;
|
||||
if (!this.isMulti) {
|
||||
comp._assembler.updateRenderDataForSwitchMaterial(comp);
|
||||
if (comp._assembler) comp._assembler.updateRenderDataForSwitchMaterial(comp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -448,6 +448,10 @@ class LetterAtlases {
|
||||
const atlas = letter.atlas;
|
||||
const comp = _assembler._renderComp;
|
||||
|
||||
if (!_usedMaterial) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否需要自动切换材质
|
||||
if (_needCheckMaterial) {
|
||||
_needCheckMaterial = false;
|
||||
@ -605,7 +609,7 @@ export default class LetterFontAssembler extends WebglBmfontAssembler {
|
||||
const verts = renderData.vDatas[0];
|
||||
const floatsPerVert = this.floatsPerVert;
|
||||
let texIdOffset = offset + this.texIdOffset;
|
||||
const id = _usedMaterial.material !== _shareAtlas.material ? letter.atlas._tmpId : letter.atlas._id;
|
||||
const id = !_usedMaterial ? 0 : (_usedMaterial.material !== _shareAtlas.material ? letter.atlas._tmpId : letter.atlas._id);
|
||||
|
||||
verts[texIdOffset] = id;
|
||||
texIdOffset += floatsPerVert;
|
||||
|
Loading…
Reference in New Issue
Block a user