Checkpoint 2:
- 调整 SimulationWorld 作为 GameFrameworkComponent 组件 - ProcedureGame 接入 SimulationWorld 生命周期(创建/清理)并在敌人 Show/Hide 时同步注册/反注册 - 增加 EnemySimData 构建与缓存去重移除,避免重复注册和悬空映射 - SimulationWorld 增加 UpsertEnemy/UpsertProjectile/UpsertPickup,支持幂等注册
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using CustomEvent;
|
||||
using DataTable;
|
||||
using Definition.Enum;
|
||||
using Entity;
|
||||
@@ -24,11 +23,11 @@ namespace Procedure
|
||||
{
|
||||
public override bool UseNativeDialog => false;
|
||||
|
||||
private HudForm _hudForm = null;
|
||||
private bool _hudInitialized = false;
|
||||
private HudForm _hudForm;
|
||||
private bool _hudInitialized;
|
||||
|
||||
private IFsm<IProcedureManager> _procedureOwner = null;
|
||||
private PlayerData _currentPlayerData = null;
|
||||
private IFsm<IProcedureManager> _procedureOwner;
|
||||
private PlayerData _currentPlayerData;
|
||||
public int CurrentLevel = 1;
|
||||
|
||||
private GameStateType _currentGameState = GameStateType.None;
|
||||
@@ -88,6 +87,7 @@ namespace Procedure
|
||||
base.OnEnter(procedureOwner);
|
||||
|
||||
_procedureOwner = procedureOwner;
|
||||
GameEntry.SimulationWorld?.Clear();
|
||||
|
||||
GameEntry.Event.Subscribe(OpenUIFormSuccessEventArgs.EventId, OpenUIFormSuccess);
|
||||
GameEntry.Event.Subscribe(ShowEntitySuccessEventArgs.EventId, ShowEntitySuccess);
|
||||
@@ -135,6 +135,7 @@ namespace Procedure
|
||||
Player = null;
|
||||
|
||||
_procedureOwner = null;
|
||||
GameEntry.SimulationWorld?.Clear();
|
||||
|
||||
GameEntry.Event.Unsubscribe(OpenUIFormSuccessEventArgs.EventId, OpenUIFormSuccess);
|
||||
GameEntry.Event.Unsubscribe(ShowEntitySuccessEventArgs.EventId, ShowEntitySuccess);
|
||||
|
||||
Reference in New Issue
Block a user