refactor(EnemyManager): 性能优化与并发安全修复

- EnemyRegistry: 移除List冗余存储, Register/Remove从O(n)→O(1)
- 增加PruneInvalidEntries显式清理接口, 消除TryGet副作用
- Remove增加不存在告警, 防重复减成负数
- 增加CTS取消飞行中的异步生成, 关卡切换时取消+重建
- ClearEnemies先快照再遍历, 防Hide回调修改集合抛异常
- entityId去掉取模复用, 直接自增保证唯一
- Enemy EntityGroup调优: Capacity→10000, ReleaseInterval→30, ExpireTime→120
This commit is contained in:
2026-06-18 17:06:10 +08:00
parent 49c300a10e
commit 000984c676
4 changed files with 56 additions and 52 deletions
+3 -3
View File
@@ -625,7 +625,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[3].m_InstanceCapacity
value: 500
value: 10000
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[4].m_InstanceCapacity
@@ -661,7 +661,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[3].m_InstanceExpireTime
value: 60
value: 120
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[4].m_InstanceExpireTime
@@ -697,7 +697,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[3].m_InstanceAutoReleaseInterval
value: 0
value: 30
objectReference: {fileID: 0}
- target: {fileID: 11494652, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EntityGroups.Array.data[4].m_InstanceAutoReleaseInterval