MCPcopy Create free account
hub / github.com/esengine/esengine / removeImmediate

Method removeImmediate

packages/core/src/ECS/Utils/EntityList.ts:65–79  ·  view source on GitHub ↗

* 立即移除实体 * @param entity 要移除的实体

(entity: Entity)

Source from the content-addressed store, hash-verified

63 * @param entity 要移除的实体
64 */
65 private removeImmediate(entity: Entity): void {
66 const index = this.buffer.indexOf(entity);
67 if (index !== -1) {
68 this.buffer.splice(index, 1);
69 this._idToEntity.delete(entity.id);
70
71 // 更新名称索引
72 this.updateNameIndex(entity, false);
73
74 // 回收实体ID到ID池
75 if (this._scene && this._scene.identifierPool) {
76 this._scene.identifierPool.checkIn(entity.id);
77 }
78 }
79 }
80
81 /**
82 * 移除所有实体

Callers 2

removeMethod · 0.95
updateListsMethod · 0.95

Calls 3

updateNameIndexMethod · 0.95
deleteMethod · 0.65
checkInMethod · 0.45

Tested by

no test coverage detected