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

Method receiveMigratedEntities

packages/core/src/ECS/Scene.ts:951–966  ·  view source on GitHub ↗

* 接收迁移的实体 * * 将从其他场景迁移来的实体添加到当前场景。 * * Receive migrated entities from another scene. * * @param entities 要接收的实体数组 | Entities to receive * * @internal

(entities: Entity[])

Source from the content-addressed store, hash-verified

949 * @internal
950 */
951 public receiveMigratedEntities(entities: Entity[]): void {
952 for (const entity of entities) {
953 entity.scene = this;
954 this.entities.add(entity);
955 this.querySystem.addEntity(entity);
956
957 for (const component of entity.components) {
958 this.componentStorageManager.addComponent(entity.id, component);
959 this.referenceTracker?.registerEntityScene(entity.id, this);
960 }
961 }
962
963 if (entities.length > 0) {
964 this.clearSystemEntityCaches();
965 }
966 }
967
968 /**
969 * 根据名称查找实体(别名方法)

Callers 2

setSceneMethod · 0.80

Calls 5

registerEntitySceneMethod · 0.80
addEntityMethod · 0.65
addMethod · 0.45
addComponentMethod · 0.45

Tested by

no test coverage detected