diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index b33aaeb..e84e164 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -58,7 +58,12 @@ "Path": "resource/map/tileMaps/Test1/shop/Shop1" } ], - "EventList": [], + "EventList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/Test1/event/\u6D4B\u8BD5\u623F\u95F4" + } + ], "Remark": "" } } \ No newline at end of file diff --git "a/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preinstall.json" "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preinstall.json" new file mode 100644 index 0000000..a9f951a --- /dev/null +++ "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preinstall.json" @@ -0,0 +1 @@ +[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":true,"WaveList":[[]]}] \ No newline at end of file diff --git "a/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png" "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png" new file mode 100644 index 0000000..1f8c70e --- /dev/null +++ "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png" Binary files differ diff --git "a/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png.import" "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png.import" new file mode 100644 index 0000000..e9f48d4 --- /dev/null +++ "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/Preview.png.import" @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://co5xect35y824" +path="res://.godot/imported/Preview.png-fc7bb7c2dfd4b0a1ba5ea4ee2d5b8746.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/Test1/event/测试房间/Preview.png" +dest_files=["res://.godot/imported/Preview.png-fc7bb7c2dfd4b0a1ba5ea4ee2d5b8746.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git "a/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/RoomInfo.json" "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/RoomInfo.json" new file mode 100644 index 0000000..21c8432 --- /dev/null +++ "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/RoomInfo.json" @@ -0,0 +1 @@ +{"Position":{"X":-19,"Y":-10},"Size":{"X":27,"Y":27},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":64,"RoomName":"\u6D4B\u8BD5\u623F\u95F4","Weight":100,"Remark":""} \ No newline at end of file diff --git "a/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/TileInfo.json" "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/TileInfo.json" new file mode 100644 index 0000000..5f99a1a --- /dev/null +++ "b/DungeonShooting_Godot/resource/map/tileMaps/Test1/event/\346\265\213\350\257\225\346\210\277\351\227\264/TileInfo.json" @@ -0,0 +1 @@ +{"NavigationVertices":[{"X":-26,"Y":-26},{"X":-26,"Y":-58},{"X":90,"Y":-58},{"X":90,"Y":36},{"X":42,"Y":36},{"X":42,"Y":150},{"X":22,"Y":150},{"X":22,"Y":36},{"X":-26,"Y":-12},{"X":-26,"Y":36},{"X":-166,"Y":-26},{"X":-166,"Y":-12},{"X":-166,"Y":52},{"X":-182,"Y":52},{"X":-26,"Y":166},{"X":-26,"Y":150},{"X":90,"Y":150},{"X":90,"Y":244},{"X":-26,"Y":244},{"X":-26,"Y":180},{"X":-182,"Y":166},{"X":-202,"Y":180},{"X":-202,"Y":52},{"X":-266,"Y":52},{"X":-266,"Y":-106},{"X":-166,"Y":-106}],"NavigationPolygon":[[0,1,2,3,4],[4,5,6,7],[0,4,7,8],[7,9,8],[10,0,8,11],[11,12,13],[14,15,6],[5,16,17,18,19],[6,5,19,14],[20,14,19,21],[20,21,22,13],[22,23,24,25,10],[22,10,11,13]],"Floor":[-2,-4,0,3,-1,-4,0,3,-1,-3,0,3,0,-2,0,3,1,-2,0,3,1,-1,0,3,2,-1,0,3,3,-1,0,3,3,0,0,3,4,0,0,3,5,0,0,3,5,1,0,3,-2,-3,0,3,-2,-2,0,3,-2,-1,0,3,-2,0,0,3,-1,-2,0,3,-1,-1,0,3,-1,0,0,3,0,-4,0,3,0,-3,0,3,0,-1,0,3,0,0,0,3,1,-4,0,3,1,-3,0,3,1,0,0,3,2,-4,0,3,2,-3,0,3,2,-2,0,3,2,0,0,3,3,-4,0,3,3,-3,0,3,3,-2,0,3,4,-4,0,3,4,-3,0,3,4,-2,0,3,4,-1,0,3,5,-4,0,3,5,-3,0,3,5,-2,0,3,5,-1,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,3,1,0,3,4,1,0,3,1,2,0,3,2,2,0,3,-2,9,0,3,-2,10,0,3,-2,11,0,3,-2,12,0,3,-2,13,0,3,-2,14,0,3,-1,9,0,3,-1,10,0,3,-1,11,0,3,-1,12,0,3,-1,13,0,3,-1,14,0,3,0,9,0,3,0,10,0,3,0,11,0,3,0,12,0,3,0,13,0,3,0,14,0,3,1,9,0,3,1,10,0,3,1,11,0,3,1,12,0,3,1,13,0,3,1,14,0,3,2,9,0,3,2,10,0,3,2,11,0,3,2,12,0,3,2,13,0,3,2,14,0,3,3,9,0,3,3,10,0,3,3,11,0,3,3,12,0,3,3,13,0,3,3,14,0,3,4,9,0,3,4,10,0,3,4,11,0,3,4,12,0,3,4,13,0,3,4,14,0,3,5,9,0,3,5,10,0,3,5,11,0,3,5,12,0,3,5,13,0,3,5,14,0,3,1,3,0,3,1,4,0,3,1,5,0,3,1,6,0,3,1,7,0,3,1,8,0,3,2,3,0,3,2,4,0,3,2,5,0,3,2,6,0,3,2,7,0,3,2,8,0,3,-17,-7,0,3,-17,-6,0,3,-16,-6,0,3,-16,-5,0,3,-15,-5,0,3,-15,-4,0,3,-14,-3,0,3,-14,-2,0,3,-13,-2,0,3,-13,-1,0,3,-12,-1,0,3,-12,0,0,3,-11,0,0,3,-11,1,0,3,-17,-5,0,3,-17,-4,0,3,-17,-3,0,3,-17,-2,0,3,-17,-1,0,3,-17,0,0,3,-17,1,0,3,-17,2,0,3,-16,-7,0,3,-16,-4,0,3,-16,-3,0,3,-16,-2,0,3,-16,-1,0,3,-16,0,0,3,-16,1,0,3,-16,2,0,3,-15,-7,0,3,-15,-6,0,3,-15,-3,0,3,-15,-2,0,3,-15,-1,0,3,-15,0,0,3,-15,1,0,3,-15,2,0,3,-14,-7,0,3,-14,-6,0,3,-14,-5,0,3,-14,-4,0,3,-14,-1,0,3,-14,0,0,3,-14,1,0,3,-14,2,0,3,-13,-7,0,3,-13,-6,0,3,-13,-5,0,3,-13,-4,0,3,-13,-3,0,3,-13,0,0,3,-13,1,0,3,-13,2,0,3,-12,-7,0,3,-12,-6,0,3,-12,-5,0,3,-12,-4,0,3,-12,-3,0,3,-12,-2,0,3,-12,1,0,3,-12,2,0,3,-11,-7,0,3,-11,-6,0,3,-11,-5,0,3,-11,-4,0,3,-11,-3,0,3,-11,-2,0,3,-11,-1,0,3,-11,2,0,3,-10,-2,0,3,-9,-2,0,3,-8,-2,0,3,-7,-2,0,3,-6,-2,0,3,-5,-2,0,3,-4,-2,0,3,-3,-2,0,3,-13,3,0,3,-13,4,0,3,-13,5,0,3,-13,6,0,3,-13,7,0,3,-13,8,0,3,-13,9,0,3,-13,10,0,3,-12,3,0,3,-12,4,0,3,-12,5,0,3,-12,6,0,3,-12,7,0,3,-12,8,0,3,-12,9,0,3,-12,10,0,3,-11,10,0,3,-10,10,0,3,-9,10,0,3,-8,10,0,3,-7,10,0,3,-6,10,0,3,-5,10,0,3,-4,10,0,3,-3,10,0,3],"Middle":[-17,-10,63,1,-17,-9,2,2,-17,-8,6,2,-16,-10,63,1,-16,-9,2,2,-16,-8,6,2,-15,-10,63,1,-15,-9,2,2,-15,-8,6,2,-14,-10,63,1,-14,-9,2,2,-14,-8,6,2,-13,-10,63,1,-13,-9,2,2,-13,-8,6,2,-12,-10,63,1,-12,-9,2,2,-12,-8,6,2,-11,-10,63,1,-11,-9,2,2,-11,-8,6,2,-11,7,54,1,-11,8,1,2,-11,9,5,2,-10,-5,54,1,-10,-4,1,2,-10,-3,5,2,-10,7,63,1,-10,8,2,2,-10,9,6,2,-9,-5,63,1,-9,-4,2,2,-9,-3,6,2,-9,7,63,1,-9,8,2,2,-9,9,6,2,-8,-5,63,1,-8,-4,2,2,-8,-3,6,2,-8,7,63,1,-8,8,2,2,-8,9,6,2,-7,-5,63,1,-7,-4,2,2,-7,-3,6,2,-7,7,63,1,-7,8,2,2,-7,9,6,2,-6,-5,63,1,-6,-4,2,2,-6,-3,6,2,-6,7,63,1,-6,8,2,2,-6,9,6,2,-5,-5,63,1,-5,-4,2,2,-5,-3,6,2,-5,7,63,1,-5,8,2,2,-5,9,6,2,-4,-5,63,1,-4,-4,2,2,-4,-3,6,2,-4,7,63,1,-4,8,2,2,-4,9,6,2,-3,-5,27,1,-3,-4,3,2,-3,-3,7,2,-3,7,27,1,-3,8,3,2,-3,9,7,2,-2,-7,63,1,-2,-6,2,2,-2,-5,6,2,-2,6,63,1,-2,7,2,2,-2,8,6,2,-1,-7,63,1,-1,-6,2,2,-1,-5,6,2,-1,6,63,1,-1,7,2,2,-1,8,6,2,0,-7,63,1,0,-6,2,2,0,-5,6,2,0,6,27,1,0,7,3,2,0,8,7,2,1,-7,63,1,1,-6,2,2,1,-5,6,2,2,-7,63,1,2,-6,2,2,2,-5,6,2,3,-7,63,1,3,-6,2,2,3,-5,6,2,3,6,54,1,3,7,1,2,3,8,5,2,4,-7,63,1,4,-6,2,2,4,-5,6,2,4,6,63,1,4,7,2,2,4,8,6,2,5,-7,63,1,5,-6,2,2,5,-5,6,2,5,6,63,1,5,7,2,2,5,8,6,2],"Top":[-19,-11,511,1,-19,-10,511,1,-19,-9,511,1,-19,-8,511,1,-19,-7,511,1,-19,-6,511,1,-19,-5,511,1,-19,-4,511,1,-19,-3,511,1,-19,-2,511,1,-19,-1,511,1,-19,0,511,1,-19,1,511,1,-19,2,511,1,-19,3,511,1,-19,4,511,1,-18,-11,511,1,-18,-10,255,1,-18,-9,219,1,-18,-8,219,1,-18,-7,219,1,-18,-6,219,1,-18,-5,219,1,-18,-4,219,1,-18,-3,219,1,-18,-2,219,1,-18,-1,219,1,-18,0,219,1,-18,1,219,1,-18,2,219,1,-18,3,507,1,-18,4,511,1,-17,-11,511,1,-17,3,504,1,-17,4,511,1,-16,-11,511,1,-16,3,504,1,-16,4,511,1,-15,-11,511,1,-15,3,504,1,-15,4,511,1,-15,5,511,1,-15,6,511,1,-15,7,511,1,-15,8,511,1,-15,9,511,1,-15,10,511,1,-15,11,511,1,-15,12,511,1,-14,-11,511,1,-14,3,216,1,-14,4,219,1,-14,5,219,1,-14,6,219,1,-14,7,219,1,-14,8,219,1,-14,9,219,1,-14,10,219,1,-14,11,507,1,-14,12,511,1,-13,-11,511,1,-13,11,504,1,-13,12,511,1,-12,-11,511,1,-12,11,504,1,-12,12,511,1,-11,-11,511,1,-11,3,432,1,-11,4,438,1,-11,5,438,1,-11,6,438,1,-11,11,504,1,-11,12,511,1,-10,-11,511,1,-10,-10,447,1,-10,-9,438,1,-10,-8,438,1,-10,-7,438,1,-10,-6,438,1,-10,-1,432,1,-10,0,438,1,-10,1,438,1,-10,2,438,1,-10,3,510,1,-10,4,511,1,-10,5,511,1,-10,6,511,1,-10,11,504,1,-10,12,511,1,-9,-11,511,1,-9,-10,511,1,-9,-9,511,1,-9,-8,511,1,-9,-7,511,1,-9,-6,511,1,-9,-1,504,1,-9,0,511,1,-9,1,511,1,-9,2,511,1,-9,3,511,1,-9,4,511,1,-9,6,511,1,-9,11,504,1,-9,12,511,1,-8,-6,511,1,-8,-1,504,1,-8,0,511,1,-8,6,511,1,-8,11,504,1,-8,12,511,1,-7,-6,511,1,-7,-1,504,1,-7,0,511,1,-7,6,511,1,-7,11,504,1,-7,12,511,1,-6,-6,511,1,-6,-1,504,1,-6,0,511,1,-6,6,511,1,-6,11,504,1,-6,12,511,1,-5,-6,511,1,-5,-1,504,1,-5,0,511,1,-5,6,511,1,-5,11,504,1,-5,12,511,1,-4,-8,511,1,-4,-7,511,1,-4,-6,511,1,-4,-1,504,1,-4,0,511,1,-4,1,511,1,-4,2,511,1,-4,3,511,1,-4,5,511,1,-4,6,511,1,-4,11,504,1,-4,12,511,1,-4,13,511,1,-4,14,511,1,-4,15,511,1,-4,16,511,1,-3,-8,511,1,-3,-7,255,1,-3,-6,219,1,-3,-1,216,1,-3,0,219,1,-3,1,219,1,-3,2,507,1,-3,3,511,1,-3,5,511,1,-3,6,255,1,-3,11,216,1,-3,12,219,1,-3,13,219,1,-3,14,219,1,-3,15,507,1,-3,16,511,1,-2,-8,511,1,-2,2,504,1,-2,3,511,1,-2,5,511,1,-2,15,504,1,-2,16,511,1,-1,-8,511,1,-1,2,504,1,-1,3,511,1,-1,4,511,1,-1,5,511,1,-1,15,504,1,-1,16,511,1,0,-8,511,1,0,2,216,1,0,3,219,1,0,4,219,1,0,5,219,1,0,15,504,1,0,16,511,1,1,-8,511,1,1,15,504,1,1,16,511,1,2,-8,511,1,2,15,504,1,2,16,511,1,3,-8,511,1,3,2,432,1,3,3,438,1,3,4,438,1,3,5,438,1,3,15,504,1,3,16,511,1,4,-8,511,1,4,2,504,1,4,3,511,1,4,4,511,1,4,5,511,1,4,15,504,1,4,16,511,1,5,-8,511,1,5,2,504,1,5,3,511,1,5,5,511,1,5,15,504,1,5,16,511,1,6,-8,511,1,6,-7,447,1,6,-6,438,1,6,-5,438,1,6,-4,438,1,6,-3,438,1,6,-2,438,1,6,-1,438,1,6,0,438,1,6,1,438,1,6,2,510,1,6,3,511,1,6,5,511,1,6,6,447,1,6,7,438,1,6,8,438,1,6,9,438,1,6,10,438,1,6,11,438,1,6,12,438,1,6,13,438,1,6,14,438,1,6,15,510,1,6,16,511,1,7,-8,511,1,7,-7,511,1,7,-6,511,1,7,-5,511,1,7,-4,511,1,7,-3,511,1,7,-2,511,1,7,-1,511,1,7,0,511,1,7,1,511,1,7,2,511,1,7,3,511,1,7,5,511,1,7,6,511,1,7,7,511,1,7,8,511,1,7,9,511,1,7,10,511,1,7,11,511,1,7,12,511,1,7,13,511,1,7,14,511,1,7,15,511,1,7,16,511,1],"CustomFloor1":[],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index aaf9cb5..7efac66 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -472,11 +472,13 @@ //横向过道 private void FullHorizontalAisle(AutoTileConfig config, Rect2 rect) { - FillRect(MapLayer.AutoAisleFloorLayer, config.Floor, rect.Position + new Vector2(0, 1), rect.Size - new Vector2(0, 2)); - FillRect(MapLayer.AutoTopLayer, config.TopMask, rect.Position - new Vector2(0, 2), new Vector2(rect.Size.X, 1)); + FillRect(MapLayer.AutoAisleFloorLayer, config.Floor, rect.Position + new Vector2(0, 2), rect.Size - new Vector2(0, 3)); + + FillRect(MapLayer.AutoTopLayer, config.TopMask, rect.Position + new Vector2(0, -2), new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoTopLayer, config.TopMask, rect.Position + new Vector2(0, rect.Size.Y), new Vector2(rect.Size.X, 1)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Top, rect.Position - new Vector2(0, 1), new Vector2(rect.Size.X, 1)); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Top, rect.Position + new Vector2(0, -1), new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_CenterTop, rect.Position, new Vector2(rect.Size.X, 1)); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_CenterBottom, rect.Position + new Vector2(0, 1), new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoTopLayer, config.Wall_Bottom, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); } diff --git a/DungeonShooting_Godot/src/framework/map/MapLayer.cs b/DungeonShooting_Godot/src/framework/map/MapLayer.cs new file mode 100644 index 0000000..f9995a5 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/MapLayer.cs @@ -0,0 +1,49 @@ + +public static class MapLayer +{ + /// + /// 自动图块地板层 + /// + public const int AutoFloorLayer = 0; + /// + /// 自定义图块地板层1 + /// + public const int CustomFloorLayer1 = AutoFloorLayer + 1; + /// + /// 自定义图块地板层2 + /// + public const int CustomFloorLayer2 = CustomFloorLayer1 + 1; + /// + /// 自定义图块地板层3 + /// + public const int CustomFloorLayer3 = CustomFloorLayer2 + 1; + /// + /// 自动图块中间层 + /// + public const int AutoMiddleLayer = CustomFloorLayer3 + 1; + /// + /// 自定义图块中间层1 + /// + public const int CustomMiddleLayer1 = AutoMiddleLayer + 1; + /// + /// 自定义图块中间层2 + /// + public const int CustomMiddleLayer2 = CustomMiddleLayer1 + 1; + /// + /// 自动图块顶层 + /// + public const int AutoTopLayer = CustomMiddleLayer2 + 1; + /// + /// 自定义图块顶层 + /// + public const int CustomTopLayer = AutoTopLayer + 1; + /// + /// 自动图块过道中的地板层, 该层只会出现在 World 场景中的 TileMap + /// + public const int AutoAisleFloorLayer = CustomTopLayer + 1; + + /// + /// 标记数据层, 特殊层, 不会出现在 TileMap 中 + /// + public const int MarkLayer = 9999; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs b/DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs index a420fe5..3738cec 100644 --- a/DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs @@ -55,11 +55,6 @@ public DoorNavigationInfo Navigation; /// - /// 连接过道使用的导航网格 (暂未用到) - /// - public NavigationPolygonData AisleNavigation; - - /// /// 连接过道使用预览纹理, 用于小地图 /// public ImageTexture AislePreviewTexture; diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs index 7ce1f1c..b8d22b5 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs @@ -169,26 +169,31 @@ private static void InitMainSourceData(TileSetTerrainInfo terrainInfo, TileSetAtlasSource tileSetAtlasSource) { //ySort - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(0, 2), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(1, 2), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(2, 2), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(3, 2), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(0, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(1, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(2, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(3, 3), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(0, 2), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(1, 2), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(2, 2), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(3, 2), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(0, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(1, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(2, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(3, 3), 39); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(5, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(6, 3), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(5, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(6, 3), 39); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(8, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(9, 3), 23); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(11, 3), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(8, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(9, 3), 39); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 1, new Vector2I(11, 3), 39); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(0, 0), 7); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(1, 0), 7); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(2, 0), 7); - SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(3, 0), 7); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(0, 0), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(1, 0), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(2, 0), 23); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(3, 0), 23); + + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(0, 1), 7); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(1, 1), 7); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(2, 1), 7); + SetAtlasSourceYSortOrigin(terrainInfo, tileSetAtlasSource, 2, new Vector2I(3, 1), 7); //碰撞器 SetAtlasSourceCollision(terrainInfo, tileSetAtlasSource, 1, new Vector2I(0, 0), true); @@ -297,8 +302,8 @@ { tileData.SetCollisionPolygonPoints(0, 0, new[] { - new Vector2(-8, 0), - new Vector2(8, 0), + new Vector2(-8, 2), + new Vector2(8, 2), new Vector2(8, 8), new Vector2(-8, 8) }); diff --git a/DungeonShooting_Godot/src/game/data/property/MapLayer.cs b/DungeonShooting_Godot/src/game/data/property/MapLayer.cs deleted file mode 100644 index f9995a5..0000000 --- a/DungeonShooting_Godot/src/game/data/property/MapLayer.cs +++ /dev/null @@ -1,49 +0,0 @@ - -public static class MapLayer -{ - /// - /// 自动图块地板层 - /// - public const int AutoFloorLayer = 0; - /// - /// 自定义图块地板层1 - /// - public const int CustomFloorLayer1 = AutoFloorLayer + 1; - /// - /// 自定义图块地板层2 - /// - public const int CustomFloorLayer2 = CustomFloorLayer1 + 1; - /// - /// 自定义图块地板层3 - /// - public const int CustomFloorLayer3 = CustomFloorLayer2 + 1; - /// - /// 自动图块中间层 - /// - public const int AutoMiddleLayer = CustomFloorLayer3 + 1; - /// - /// 自定义图块中间层1 - /// - public const int CustomMiddleLayer1 = AutoMiddleLayer + 1; - /// - /// 自定义图块中间层2 - /// - public const int CustomMiddleLayer2 = CustomMiddleLayer1 + 1; - /// - /// 自动图块顶层 - /// - public const int AutoTopLayer = CustomMiddleLayer2 + 1; - /// - /// 自定义图块顶层 - /// - public const int CustomTopLayer = AutoTopLayer + 1; - /// - /// 自动图块过道中的地板层, 该层只会出现在 World 场景中的 TileMap - /// - public const int AutoAisleFloorLayer = CustomTopLayer + 1; - - /// - /// 标记数据层, 特殊层, 不会出现在 TileMap 中 - /// - public const int MarkLayer = 9999; -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 9172f1e..9f11cbc 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -196,7 +196,7 @@ UiManager.Open_Loading(); yield return 0; //生成地牢房间 - var random = new SeedRandom(); + var random = new SeedRandom(1); _dungeonGenerator = new DungeonGenerator(CurrConfig, random); var rule = new DefaultDungeonRule(_dungeonGenerator); if (!_dungeonGenerator.Generate(rule)) //生成房间失败 @@ -236,13 +236,10 @@ //yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); //生成寻路网格, 这一步操作只生成过道的导航 - _dungeonTileMap.GenerateNavigationPolygon(MapLayer.AutoAisleFloorLayer); - yield return 0; - //将导航网格绑定到 DoorInfo 上 - BindAisleNavigation(StartRoomInfo, _dungeonTileMap.GetPolygonData()); + //_dungeonTileMap.GenerateNavigationPolygon(MapLayer.AutoAisleFloorLayer); yield return 0; //挂载过道导航区域 - _dungeonTileMap.MountNavigationPolygon(World.NavigationRoot); + //_dungeonTileMap.MountNavigationPolygon(World.NavigationRoot); yield return 0; //初始化所有房间 yield return _dungeonGenerator.EachRoomCoroutine(InitRoom); @@ -319,52 +316,6 @@ } } - //将导航网格绑定到 DoorInfo 上 - private void BindAisleNavigation(RoomInfo startRoom, NavigationPolygonData[] polygonDatas) - { - var list = polygonDatas.ToList(); - startRoom.EachRoom(roomInfo => - { - if (roomInfo.Doors != null) - { - foreach (var roomInfoDoor in roomInfo.Doors) - { - if (roomInfoDoor.IsForward) - { - var doorPosition = roomInfoDoor.GetWorldOriginPosition(); - for (var i = 0; i < list.Count; i++) - { - var data = list[i]; - var points = data.GetPoints(); - if (InLength(points, doorPosition, 32) && InLength(points, roomInfoDoor.GetWorldEndPosition(), 32)) - { - roomInfoDoor.AisleNavigation = data; - roomInfoDoor.ConnectDoor.AisleNavigation = data; - - list.RemoveAt(i); - } - } - - //Debug.Log(roomInfo.Id + ", 是否找到连接过道: " + flag); - } - } - } - }); - } - - private bool InLength(Vector2[] points, Vector2 targetPoint, float len) - { - foreach (var point in points) - { - if (point.DistanceSquaredTo(targetPoint) <= len * len) - { - return true; - } - } - - return false; - } - // 初始化房间 private void InitRoom(RoomInfo roomInfo) {