diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs index fc17fff..cc95225 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs @@ -12,14 +12,28 @@ { private class SceneNode : IEquatable { - public SceneNode(string type, string name) + public SceneNode(string type, string name, string scriptPath) { Type = type; Name = name; + ScriptPath = scriptPath; } + /// + /// 节点类型 + /// public string Type; + /// + /// 节点名称 + /// public string Name; + /// + /// 节点脚本路径 + /// + public string ScriptPath; + /// + /// 子节点 + /// public List Children = new List(); public bool Equals(SceneNode other) @@ -29,7 +43,7 @@ return false; } - if (other.Name != Name || other.Type != Type) + if (other.Name != Name || other.Type != Type || other.ScriptPath != ScriptPath) { return false; } @@ -127,7 +141,17 @@ private SceneNode ParseNodeTree(Node node) { - var uiNode = new SceneNode(node.GetType().FullName, node.Name); + var script = node.GetScript().As(); + string scriptPath; + if (script == null) + { + scriptPath = null; + } + else + { + scriptPath = script.ResourcePath; + } + var uiNode = new SceneNode(node.GetType().FullName, node.Name, scriptPath); var count = node.GetChildCount(); for (var i = 0; i < count; i++) { diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index 44893c4..0559237 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -1127,7 +1127,7 @@ //交集范围够生成门 if (range.Y - range.X >= GameConfig.CorridorWidth * GameConfig.TileCellSize) { - rangeList.Add(new Vector2I((int)(range.X / 16), (int)(range.Y / 16) - GameConfig.CorridorWidth)); + rangeList.Add(new Vector2I((int)(range.X / GameConfig.TileCellSize), (int)(range.Y / GameConfig.TileCellSize) - GameConfig.CorridorWidth)); } } }