修复QuerySystem组件掩码索引使用toString()返回[object Object]的问题 #70

This commit is contained in:
YHH
2025-09-30 16:38:32 +08:00
parent 38763de7f6
commit a5e70bcd99
2 changed files with 58 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ export class QuerySystem {
const mask = entity.componentMask;
// 组件掩码索引
const maskKey = mask.toString();
const maskKey = BitMask64Utils.toString(mask, 16);
const maskSet = this.entityIndex.byMask.get(maskKey) || this.createAndSetMaskIndex(maskKey);
maskSet.add(entity);
@@ -348,7 +348,7 @@ export class QuerySystem {
const mask = entity.componentMask;
// 从组件掩码索引移除
const maskKey = mask.toString();
const maskKey = BitMask64Utils.toString(mask, 16);
const maskSet = this.entityIndex.byMask.get(maskKey);
if (maskSet) {
maskSet.delete(entity);