diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn index bead9d8..6b5b0c7 100644 --- a/DungeonShooting_Godot/scene/World.tscn +++ b/DungeonShooting_Godot/scene/World.tscn @@ -22,7 +22,7 @@ [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_g06jj") -[node name="TileRoot" type="TileMap" parent="."] +[node name="TileRoot" type="TileMap" parent="." groups=["navigation"]] format = 2 layer_0/name = "Floor" layer_0/z_index = -10 diff --git a/DungeonShooting_Godot/src/framework/map/fog/FogMask.cs b/DungeonShooting_Godot/src/framework/map/fog/FogMask.cs index c25df57..1052dd7 100644 --- a/DungeonShooting_Godot/src/framework/map/fog/FogMask.cs +++ b/DungeonShooting_Godot/src/framework/map/fog/FogMask.cs @@ -110,7 +110,7 @@ { var tileMap = GameApplication.Instance.World.TileRoot; var autoConfig = GameApplication.Instance.DungeonManager.AutoTileConfig; - var wallCoord = autoConfig.WALL_BLOCK.AutoTileCoords; + var wallCoords = autoConfig.TopMask.AutoTileCoords; var (x, y) = position; var (width, height) = size; x -= 1; @@ -123,7 +123,7 @@ { var pos = new Vector2I(i + x, j + y); //说明是外层墙壁 - if (tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) == wallCoord) + if (tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) == wallCoords) { var left = IsEmptyCell(tileMap, new Vector2I(pos.X - 1, pos.Y)); var right = IsEmptyCell(tileMap, new Vector2I(pos.X + 1, pos.Y)); diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 9132f18..46d6c53 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -208,14 +208,14 @@ AutoTileConfig = new AutoTileConfig(); _dungeonTileMap = new DungeonTileMap(World.TileRoot); yield return _dungeonTileMap.AutoFillRoomTile(AutoTileConfig, _dungeonGenerator.StartRoomInfo, random); - yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); + //yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); //生成寻路网格, 这一步操作只生成过道的导航 _dungeonTileMap.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); yield return 0; //将导航网格绑定到 DoorInfo 上 - //BindAisleNavigation(StartRoomInfo, _dungeonTileMap.GetPolygonData()); - //yield return 0; + BindAisleNavigation(StartRoomInfo, _dungeonTileMap.GetPolygonData()); + yield return 0; //挂载过道导航区域 _dungeonTileMap.MountNavigationPolygon(World.TileRoot); yield return 0; @@ -306,7 +306,6 @@ { if (roomInfoDoor.IsForward) { - var flag = false; var doorPosition = roomInfoDoor.GetWorldOriginPosition(); for (var i = 0; i < list.Count; i++) { @@ -317,7 +316,6 @@ roomInfoDoor.AisleNavigation = data; roomInfoDoor.ConnectDoor.AisleNavigation = data; - flag = true; list.RemoveAt(i); } } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 5398fe2..58b078d 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -761,10 +761,10 @@ //绘制临时边界 var pos = new List(); - for (var x = xStart - 2; x <= xEnd + 2; x++) + for (var x = xStart - 3; x <= xEnd + 3; x++) { - var p1 = new Vector2I(x, yStart - 3); - var p2 = new Vector2I(x, yEnd + 2); + var p1 = new Vector2I(x, yStart - 4); + var p2 = new Vector2I(x, yEnd + 3); pos.Add(p1); pos.Add(p2); //上横 @@ -772,10 +772,10 @@ //下横 SetCell(GetFloorLayer(), p2, _autoTileConfig.TopMask.SourceId, _autoTileConfig.TopMask.AutoTileCoords); } - for (var y = yStart - 3; y <= yEnd + 2; y++) + for (var y = yStart - 4; y <= yEnd + 3; y++) { - var p1 = new Vector2I(xStart - 2, y); - var p2 = new Vector2I(xEnd + 2, y); + var p1 = new Vector2I(xStart - 3, y); + var p2 = new Vector2I(xEnd + 3, y); pos.Add(p1); pos.Add(p2); //左竖 @@ -785,9 +785,9 @@ } //计算需要绘制的图块 - for (var x = xStart - 1; x <= xEnd + 1; x++) + for (var x = xStart - 2; x <= xEnd + 2; x++) { - for (var y = yStart - 2; y <= yEnd + 1; y++) + for (var y = yStart - 3; y <= yEnd + 2; y++) { if (!_autoCellLayerGrid.Contains(x, y) && !_autoCellLayerGrid.Contains(x, y + 1)) {