diff --git a/DungeonShooting_Godot/src/game/ui/roomMap/RoomMapPanel.cs b/DungeonShooting_Godot/src/game/ui/roomMap/RoomMapPanel.cs index b3efc46..46781e0 100644 --- a/DungeonShooting_Godot/src/game/ui/roomMap/RoomMapPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/roomMap/RoomMapPanel.cs @@ -6,9 +6,10 @@ public partial class RoomMapPanel : RoomMap { - private EventFactory _factory = EventManager.CreateEventFactory(); private List _needRefresh = new List(); + private List _enemyList = new List(); + private Stack _spriteStack = new Stack(); public override void OnCreateUi() { @@ -36,7 +37,20 @@ // S_RoomMap.Instance.HideUi(); // World.Current.Pause = false; // } - + + //更新敌人位置 + if (World.Current != null) + { + foreach (var enemy in World.Current.Enemy_InstanceList) + { + if (!enemy.IsDestroyed && !enemy.IsDie) + { + + } + } + } + + //更新预览图标 if (_needRefresh.Count > 0) { foreach (var roomDoorInfo in _needRefresh) @@ -46,7 +60,8 @@ _needRefresh.Clear(); } - S_Root.Instance.Position = S_DrawContainer.Instance.Size / 2 - Player.Current.Position / 16 * S_Root.Instance.Scale; + //更新地图中心点位置 + S_Root.Instance.Position = CalcRootPosition(Player.Current.Position); } //初始化小地图 @@ -157,4 +172,9 @@ return unknownSprite; } + private Vector2 CalcRootPosition(Vector2 pos) + { + return S_DrawContainer.Instance.Size / 2 - pos / 16 * S_Root.Instance.Scale; + } + }