diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
index 0ec5459..270af72 100644
--- a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
+++ b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
@@ -106,10 +106,8 @@
activityMark.GetParent().RemoveChild(activityMark);
var pos = activityMark.GlobalPosition - offset;
_tileRoot.AddChild(activityMark);
- activityMark.Owner = _tileRoot;
- activityMark.GlobalPosition = roomInfo.GetWorldPosition() + pos;
- activityMark.Visible = false;
- activityMark.SetActive(false);
+ activityMark.Position = roomInfo.GetWorldPosition() + pos;
+ activityMark.TileRoot = _tileRoot;
}
roomInfo.ActivityMarks.AddRange(activityMarks);
diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
index e1e170a..2817166 100644
--- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
+++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
@@ -37,6 +37,11 @@
///
[Export]
public float DelayTime = 0;
+
+ ///
+ /// 当前标记所在Tile节点
+ ///
+ public TileMap TileRoot;
///
/// 绘制的颜色
@@ -135,9 +140,25 @@
///
public void SetActive(bool flag)
{
- SetProcess(flag);
- SetProcessInternal(flag);
- SetPhysicsProcess(flag);
- SetPhysicsProcessInternal(flag);
+ var parent = GetParent();
+ if (flag)
+ {
+ if (parent == null)
+ {
+ TileRoot.AddChild(this);
+ }
+ else if (parent != TileRoot)
+ {
+ parent.RemoveChild(this);
+ TileRoot.AddChild(this);
+ }
+ }
+ else
+ {
+ if (parent != null)
+ {
+ parent.RemoveChild(this);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs
index fa6ab35..a081f4a 100644
--- a/DungeonShooting_Godot/src/game/room/RoomManager.cs
+++ b/DungeonShooting_Godot/src/game/room/RoomManager.cs
@@ -28,6 +28,11 @@
public Player Player { get; private set; }
///
+ /// 起始房间
+ ///
+ public RoomInfo StartRoom => _dungeonGenerator.StartRoom;
+
+ ///
/// 当前玩家所在的房间
///
public RoomInfo ActiveRoom => Player?.Affiliation?.RoomInfo;