优化EntitySystem初始化逻辑/防止多次初始化

增加matcher和entitysystem的测试
This commit is contained in:
YHH
2025-07-30 15:42:19 +08:00
parent 01fa33e122
commit 65386ff731
13 changed files with 2685 additions and 5 deletions

View File

@@ -527,7 +527,9 @@ export class Entity {
}
// 调用组件的生命周期方法
component.onRemovedFromEntity();
if (component.onRemovedFromEntity) {
component.onRemovedFromEntity();
}
// 发射组件移除事件
if (Entity.eventBus) {