diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json index afd9094..afaae27 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json @@ -1 +1,16 @@ -{"Position":{"X":-8,"Y":-5},"Size":{"X":22,"Y":20},"DoorAreaInfos":[{"Direction":3,"Start":16,"End":-16},{"Direction":2,"Start":16,"End":-16},{"Direction":1,"Start":16,"End":-16},{"Direction":0,"Start":16,"End":-16}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Room1","Weight":100,"Remark":""} \ No newline at end of file +{ + "Position": { + "X": -8, + "Y": -5 + }, + "Size": { + "X": 22, + "Y": 20 + }, + "DoorAreaInfos": [], + "GroupName": "TestGroup1", + "RoomType": 0, + "RoomName": "Room1", + "Weight": 100, + "Remark": "" +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json index 3b1bc6d..a1edc66 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json @@ -1 +1,1885 @@ -{"NavigationList":[{"Type":0,"Points":[-72,-56,120,-56,120,8,200,8,200,224,88,224,88,112,-40,112,-40,208,-104,208,-104,-8,-88,-8,-88,-24,-72,-24]},{"Type":1,"Points":[-40,-32,56,-32,56,72,-8,72,-8,40,-40,40]}],"Floor":[-5,-4,0,0,8,-5,-3,0,0,8,-5,-2,0,0,8,-5,-1,0,0,8,-5,0,0,0,8,-5,1,0,0,8,-5,2,0,0,8,-5,3,0,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-3,0,3,4,-7,13,0,2,2,-6,-5,0,3,4,-6,-4,0,3,3,-6,13,0,2,2,-5,13,0,2,2,-4,13,0,2,2,-3,13,0,2,2,-2,-2,0,1,2,-2,-1,0,1,3,-2,0,0,1,3,-2,7,0,1,2,-2,8,0,1,3,-2,9,0,1,3,-2,10,0,1,3,-2,11,0,1,3,-2,12,0,1,3,-2,13,0,13,2,-1,-2,0,2,2,-1,7,0,2,2,0,-2,0,2,2,0,1,0,1,4,0,2,0,1,3,0,7,0,2,2,1,-2,0,2,2,1,7,0,2,2,2,-2,0,3,2,2,-1,0,3,3,2,0,0,3,3,2,1,0,3,3,2,2,0,3,3,2,7,0,2,2,3,7,0,2,2,4,7,0,3,2,4,8,0,3,3,4,9,0,3,3,4,10,0,3,3,4,11,0,3,3,4,12,0,3,3,4,13,0,3,3,4,14,0,11,2,5,14,0,2,2,6,14,0,2,2,7,14,0,2,2,8,-5,0,1,4,8,-4,0,1,3,8,-3,0,1,3,8,-2,0,1,3,8,14,0,2,2,9,14,0,2,2,10,14,0,2,2,11,14,0,2,2,12,14,0,2,2,13,-1,0,1,4,13,0,0,1,3,13,1,0,1,3,13,2,0,1,3,13,3,0,1,3,13,4,0,1,3,13,5,0,1,3,13,6,0,1,3,13,7,0,1,3,13,8,0,1,3,13,9,0,1,3,13,10,0,1,3,13,11,0,1,3,13,12,0,1,3,13,13,0,1,3,13,14,0,13,2]} \ No newline at end of file +{ + "NavigationList": [ + { + "Type": 0, + "Points": [ + -72, + -56, + 120, + -56, + 120, + 8, + 200, + 8, + 200, + 224, + 88, + 224, + 88, + 112, + -40, + 112, + -40, + 208, + -104, + 208, + -104, + -8, + -88, + -8, + -88, + -24, + -72, + -24 + ] + }, + { + "Type": 1, + "Points": [ + -40, + -32, + 56, + -32, + 56, + 72, + -8, + 72, + -8, + 40, + -40, + 40 + ] + } + ], + "Floor": [ + -5, + -4, + 0, + 0, + 8, + -5, + -3, + 0, + 0, + 8, + -5, + -2, + 0, + 0, + 8, + -5, + -1, + 0, + 0, + 8, + -5, + 0, + 0, + 0, + 8, + -5, + 1, + 0, + 0, + 8, + -5, + 2, + 0, + 0, + 8, + -5, + 3, + 0, + 0, + 8, + -5, + 4, + 0, + 0, + 8, + -5, + 5, + 0, + 0, + 8, + -5, + 6, + 0, + 0, + 8, + -5, + 7, + 0, + 0, + 8, + -5, + 8, + 0, + 0, + 8, + -5, + 9, + 0, + 0, + 8, + -5, + 10, + 0, + 0, + 8, + -5, + 11, + 0, + 0, + 8, + -5, + 12, + 0, + 0, + 8, + -4, + -4, + 0, + 0, + 8, + -4, + -3, + 0, + 0, + 8, + -4, + -2, + 0, + 0, + 8, + -4, + -1, + 0, + 0, + 8, + -4, + 0, + 0, + 0, + 8, + -4, + 1, + 0, + 0, + 8, + -4, + 5, + 0, + 0, + 8, + -4, + 4, + 0, + 0, + 8, + -4, + 3, + 0, + 0, + 8, + -4, + 2, + 0, + 0, + 8, + -4, + 6, + 0, + 0, + 8, + -4, + 7, + 0, + 0, + 8, + -4, + 8, + 0, + 0, + 8, + -4, + 9, + 0, + 0, + 8, + -4, + 10, + 0, + 0, + 8, + -4, + 11, + 0, + 0, + 8, + -4, + 12, + 0, + 0, + 8, + -3, + -4, + 0, + 0, + 8, + -3, + -3, + 0, + 0, + 8, + -3, + 4, + 0, + 0, + 8, + -3, + 5, + 0, + 0, + 8, + -3, + 1, + 0, + 0, + 8, + -3, + 0, + 0, + 0, + 8, + -3, + -1, + 0, + 0, + 8, + -3, + -2, + 0, + 0, + 8, + -3, + 3, + 0, + 0, + 8, + -3, + 2, + 0, + 0, + 8, + -3, + 6, + 0, + 0, + 8, + -3, + 7, + 0, + 0, + 8, + -3, + 8, + 0, + 0, + 8, + -3, + 9, + 0, + 0, + 8, + -3, + 10, + 0, + 0, + 8, + -3, + 11, + 0, + 0, + 8, + -3, + 12, + 0, + 0, + 8, + -2, + -4, + 0, + 0, + 8, + -2, + -3, + 0, + 0, + 8, + -2, + 5, + 0, + 0, + 8, + -2, + 4, + 0, + 0, + 8, + -2, + 3, + 0, + 0, + 8, + -2, + 2, + 0, + 0, + 8, + -2, + 6, + 0, + 0, + 8, + -1, + -4, + 0, + 0, + 8, + -1, + -3, + 0, + 0, + 8, + -1, + 3, + 0, + 0, + 8, + -1, + 2, + 0, + 0, + 8, + -1, + 4, + 0, + 0, + 8, + -1, + 5, + 0, + 0, + 8, + -1, + 6, + 0, + 0, + 8, + 0, + -4, + 0, + 0, + 8, + 0, + -3, + 0, + 0, + 8, + 0, + 4, + 0, + 0, + 8, + 0, + 5, + 0, + 0, + 8, + 0, + 6, + 0, + 0, + 8, + 1, + -4, + 0, + 0, + 8, + 1, + -3, + 0, + 0, + 8, + 1, + 4, + 0, + 0, + 8, + 1, + 5, + 0, + 0, + 8, + 1, + 6, + 0, + 0, + 8, + 2, + -4, + 0, + 0, + 8, + 2, + -3, + 0, + 0, + 8, + 2, + 4, + 0, + 0, + 8, + 2, + 5, + 0, + 0, + 8, + 2, + 6, + 0, + 0, + 8, + 3, + -4, + 0, + 0, + 8, + 3, + -3, + 0, + 0, + 8, + 3, + -2, + 0, + 0, + 8, + 3, + -1, + 0, + 0, + 8, + 3, + 0, + 0, + 0, + 8, + 3, + 1, + 0, + 0, + 8, + 3, + 2, + 0, + 0, + 8, + 3, + 3, + 0, + 0, + 8, + 3, + 4, + 0, + 0, + 8, + 3, + 5, + 0, + 0, + 8, + 3, + 6, + 0, + 0, + 8, + 4, + -4, + 0, + 0, + 8, + 4, + -3, + 0, + 0, + 8, + 4, + -2, + 0, + 0, + 8, + 4, + -1, + 0, + 0, + 8, + 4, + 0, + 0, + 0, + 8, + 4, + 1, + 0, + 0, + 8, + 4, + 2, + 0, + 0, + 8, + 4, + 3, + 0, + 0, + 8, + 4, + 4, + 0, + 0, + 8, + 4, + 5, + 0, + 0, + 8, + 4, + 6, + 0, + 0, + 8, + 5, + -4, + 0, + 0, + 8, + 5, + -3, + 0, + 0, + 8, + 5, + -2, + 0, + 0, + 8, + 5, + -1, + 0, + 0, + 8, + 5, + 0, + 0, + 0, + 8, + 5, + 1, + 0, + 0, + 8, + 5, + 2, + 0, + 0, + 8, + 5, + 3, + 0, + 0, + 8, + 5, + 4, + 0, + 0, + 8, + 5, + 5, + 0, + 0, + 8, + 5, + 6, + 0, + 0, + 8, + 5, + 7, + 0, + 0, + 8, + 5, + 8, + 0, + 0, + 8, + 5, + 9, + 0, + 0, + 8, + 5, + 10, + 0, + 0, + 8, + 5, + 11, + 0, + 0, + 8, + 5, + 12, + 0, + 0, + 8, + 5, + 13, + 0, + 0, + 8, + 6, + -4, + 0, + 0, + 8, + 6, + -3, + 0, + 0, + 8, + 6, + -2, + 0, + 0, + 8, + 6, + -1, + 0, + 0, + 8, + 6, + 0, + 0, + 0, + 8, + 6, + 1, + 0, + 0, + 8, + 6, + 2, + 0, + 0, + 8, + 6, + 3, + 0, + 0, + 8, + 6, + 4, + 0, + 0, + 8, + 6, + 5, + 0, + 0, + 8, + 6, + 6, + 0, + 0, + 8, + 6, + 7, + 0, + 0, + 8, + 6, + 8, + 0, + 0, + 8, + 6, + 9, + 0, + 0, + 8, + 6, + 10, + 0, + 0, + 8, + 6, + 11, + 0, + 0, + 8, + 6, + 12, + 0, + 0, + 8, + 6, + 13, + 0, + 0, + 8, + 7, + -4, + 0, + 0, + 8, + 7, + -3, + 0, + 0, + 8, + 7, + -2, + 0, + 0, + 8, + 7, + -1, + 0, + 0, + 8, + 7, + 0, + 0, + 0, + 8, + 7, + 1, + 0, + 0, + 8, + 7, + 2, + 0, + 0, + 8, + 7, + 3, + 0, + 0, + 8, + 7, + 4, + 0, + 0, + 8, + 7, + 5, + 0, + 0, + 8, + 7, + 6, + 0, + 0, + 8, + 7, + 7, + 0, + 0, + 8, + 7, + 8, + 0, + 0, + 8, + 7, + 9, + 0, + 0, + 8, + 7, + 10, + 0, + 0, + 8, + 7, + 11, + 0, + 0, + 8, + 7, + 12, + 0, + 0, + 8, + 7, + 13, + 0, + 0, + 8, + 8, + 0, + 0, + 0, + 8, + 8, + 1, + 0, + 0, + 8, + 8, + 2, + 0, + 0, + 8, + 8, + 3, + 0, + 0, + 8, + 8, + 4, + 0, + 0, + 8, + 8, + 5, + 0, + 0, + 8, + 8, + 6, + 0, + 0, + 8, + 8, + 7, + 0, + 0, + 8, + 8, + 8, + 0, + 0, + 8, + 8, + 9, + 0, + 0, + 8, + 8, + 10, + 0, + 0, + 8, + 8, + 11, + 0, + 0, + 8, + 8, + 12, + 0, + 0, + 8, + 8, + 13, + 0, + 0, + 8, + 9, + 0, + 0, + 0, + 8, + 9, + 1, + 0, + 0, + 8, + 9, + 2, + 0, + 0, + 8, + 9, + 3, + 0, + 0, + 8, + 9, + 4, + 0, + 0, + 8, + 9, + 5, + 0, + 0, + 8, + 9, + 6, + 0, + 0, + 8, + 9, + 7, + 0, + 0, + 8, + 9, + 8, + 0, + 0, + 8, + 9, + 9, + 0, + 0, + 8, + 9, + 10, + 0, + 0, + 8, + 9, + 11, + 0, + 0, + 8, + 9, + 12, + 0, + 0, + 8, + 9, + 13, + 0, + 0, + 8, + 10, + 0, + 0, + 0, + 8, + 10, + 1, + 0, + 0, + 8, + 10, + 2, + 0, + 0, + 8, + 10, + 3, + 0, + 0, + 8, + 10, + 4, + 0, + 0, + 8, + 10, + 5, + 0, + 0, + 8, + 10, + 6, + 0, + 0, + 8, + 10, + 7, + 0, + 0, + 8, + 10, + 8, + 0, + 0, + 8, + 10, + 9, + 0, + 0, + 8, + 10, + 10, + 0, + 0, + 8, + 10, + 11, + 0, + 0, + 8, + 10, + 12, + 0, + 0, + 8, + 10, + 13, + 0, + 0, + 8, + 11, + 0, + 0, + 0, + 8, + 11, + 1, + 0, + 0, + 8, + 11, + 2, + 0, + 0, + 8, + 11, + 3, + 0, + 0, + 8, + 11, + 4, + 0, + 0, + 8, + 11, + 5, + 0, + 0, + 8, + 11, + 6, + 0, + 0, + 8, + 11, + 7, + 0, + 0, + 8, + 11, + 8, + 0, + 0, + 8, + 11, + 9, + 0, + 0, + 8, + 11, + 10, + 0, + 0, + 8, + 11, + 11, + 0, + 0, + 8, + 11, + 12, + 0, + 0, + 8, + 11, + 13, + 0, + 0, + 8, + 12, + 0, + 0, + 0, + 8, + 12, + 1, + 0, + 0, + 8, + 12, + 2, + 0, + 0, + 8, + 12, + 3, + 0, + 0, + 8, + 12, + 4, + 0, + 0, + 8, + 12, + 5, + 0, + 0, + 8, + 12, + 6, + 0, + 0, + 8, + 12, + 7, + 0, + 0, + 8, + 12, + 8, + 0, + 0, + 8, + 12, + 9, + 0, + 0, + 8, + 12, + 10, + 0, + 0, + 8, + 12, + 11, + 0, + 0, + 8, + 12, + 12, + 0, + 0, + 8, + 12, + 13, + 0, + 0, + 8, + -7, + -1, + 0, + 0, + 8, + -7, + 0, + 0, + 0, + 8, + -7, + 1, + 0, + 0, + 8, + -7, + 2, + 0, + 0, + 8, + -7, + 3, + 0, + 0, + 8, + -7, + 4, + 0, + 0, + 8, + -7, + 5, + 0, + 0, + 8, + -7, + 6, + 0, + 0, + 8, + -7, + 7, + 0, + 0, + 8, + -7, + 8, + 0, + 0, + 8, + -7, + 9, + 0, + 0, + 8, + -7, + 10, + 0, + 0, + 8, + -7, + 11, + 0, + 0, + 8, + -7, + 12, + 0, + 0, + 8, + -6, + -2, + 0, + 0, + 8, + -6, + -1, + 0, + 0, + 8, + -6, + 0, + 0, + 0, + 8, + -6, + 1, + 0, + 0, + 8, + -6, + 2, + 0, + 0, + 8, + -6, + 3, + 0, + 0, + 8, + -6, + 4, + 0, + 0, + 8, + -6, + 5, + 0, + 0, + 8, + -6, + 6, + 0, + 0, + 8, + -6, + 7, + 0, + 0, + 8, + -6, + 8, + 0, + 0, + 8, + -6, + 9, + 0, + 0, + 8, + -6, + 10, + 0, + 0, + 8, + -6, + 11, + 0, + 0, + 8, + -6, + 12, + 0, + 0, + 8 + ], + "Middle": [ + -7, + -2, + 0, + 3, + 7, + -6, + -3, + 0, + 3, + 7, + -5, + -5, + 0, + 2, + 7, + -4, + -5, + 0, + 2, + 7, + -3, + -5, + 0, + 2, + 7, + -2, + -5, + 0, + 2, + 7, + -2, + 1, + 0, + 1, + 7, + -1, + -5, + 0, + 2, + 7, + -1, + 1, + 0, + 2, + 7, + 0, + -5, + 0, + 2, + 7, + 0, + 3, + 0, + 1, + 7, + 1, + -5, + 0, + 2, + 7, + 1, + 3, + 0, + 2, + 7, + 2, + -5, + 0, + 2, + 7, + 2, + 3, + 0, + 3, + 7, + 3, + -5, + 0, + 2, + 7, + 4, + -5, + 0, + 2, + 7, + 5, + -5, + 0, + 2, + 7, + 6, + -5, + 0, + 2, + 7, + 7, + -5, + 0, + 2, + 7, + 8, + -1, + 0, + 1, + 7, + 9, + -1, + 0, + 2, + 7, + 10, + -1, + 0, + 2, + 7, + 11, + -1, + 0, + 2, + 7, + 12, + -1, + 0, + 2, + 7 + ], + "Top": [ + -8, + -2, + 0, + 3, + 4, + -8, + -1, + 0, + 3, + 3, + -8, + 0, + 0, + 3, + 3, + -8, + 1, + 0, + 3, + 3, + -8, + 2, + 0, + 3, + 3, + -8, + 3, + 0, + 3, + 3, + -8, + 4, + 0, + 3, + 3, + -8, + 5, + 0, + 3, + 3, + -8, + 6, + 0, + 3, + 3, + -8, + 7, + 0, + 3, + 3, + -8, + 8, + 0, + 3, + 3, + -8, + 9, + 0, + 3, + 3, + -8, + 10, + 0, + 3, + 3, + -8, + 11, + 0, + 3, + 3, + -8, + 12, + 0, + 3, + 3, + -8, + 13, + 0, + 11, + 2, + -7, + -3, + 0, + 3, + 4, + -7, + 13, + 0, + 2, + 2, + -6, + -5, + 0, + 3, + 4, + -6, + -4, + 0, + 3, + 3, + -6, + 13, + 0, + 2, + 2, + -5, + 13, + 0, + 2, + 2, + -4, + 13, + 0, + 2, + 2, + -3, + 13, + 0, + 2, + 2, + -2, + -2, + 0, + 1, + 2, + -2, + -1, + 0, + 1, + 3, + -2, + 0, + 0, + 1, + 3, + -2, + 7, + 0, + 1, + 2, + -2, + 8, + 0, + 1, + 3, + -2, + 9, + 0, + 1, + 3, + -2, + 10, + 0, + 1, + 3, + -2, + 11, + 0, + 1, + 3, + -2, + 12, + 0, + 1, + 3, + -2, + 13, + 0, + 13, + 2, + -1, + -2, + 0, + 2, + 2, + -1, + 7, + 0, + 2, + 2, + 0, + -2, + 0, + 2, + 2, + 0, + 1, + 0, + 1, + 4, + 0, + 2, + 0, + 1, + 3, + 0, + 7, + 0, + 2, + 2, + 1, + -2, + 0, + 2, + 2, + 1, + 7, + 0, + 2, + 2, + 2, + -2, + 0, + 3, + 2, + 2, + -1, + 0, + 3, + 3, + 2, + 0, + 0, + 3, + 3, + 2, + 1, + 0, + 3, + 3, + 2, + 2, + 0, + 3, + 3, + 2, + 7, + 0, + 2, + 2, + 3, + 7, + 0, + 2, + 2, + 4, + 7, + 0, + 3, + 2, + 4, + 8, + 0, + 3, + 3, + 4, + 9, + 0, + 3, + 3, + 4, + 10, + 0, + 3, + 3, + 4, + 11, + 0, + 3, + 3, + 4, + 12, + 0, + 3, + 3, + 4, + 13, + 0, + 3, + 3, + 4, + 14, + 0, + 11, + 2, + 5, + 14, + 0, + 2, + 2, + 6, + 14, + 0, + 2, + 2, + 7, + 14, + 0, + 2, + 2, + 8, + -5, + 0, + 1, + 4, + 8, + -4, + 0, + 1, + 3, + 8, + -3, + 0, + 1, + 3, + 8, + -2, + 0, + 1, + 3, + 8, + 14, + 0, + 2, + 2, + 9, + 14, + 0, + 2, + 2, + 10, + 14, + 0, + 2, + 2, + 11, + 14, + 0, + 2, + 2, + 12, + 14, + 0, + 2, + 2, + 13, + -1, + 0, + 1, + 4, + 13, + 0, + 0, + 1, + 3, + 13, + 1, + 0, + 1, + 3, + 13, + 2, + 0, + 1, + 3, + 13, + 3, + 0, + 1, + 3, + 13, + 4, + 0, + 1, + 3, + 13, + 5, + 0, + 1, + 3, + 13, + 6, + 0, + 1, + 3, + 13, + 7, + 0, + 1, + 3, + 13, + 8, + 0, + 1, + 3, + 13, + 9, + 0, + 1, + 3, + 13, + 10, + 0, + 1, + 3, + 13, + 11, + 0, + 1, + 3, + 13, + 12, + 0, + 1, + 3, + 13, + 13, + 0, + 1, + 3, + 13, + 14, + 0, + 13, + 2 + ] +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs index f4b650c..e905887 100644 --- a/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs +++ b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs @@ -38,15 +38,15 @@ var asText = ResourceManager.LoadText(RoomPath); _roomInfo = JsonSerializer.Deserialize<DungeonRoomInfo>(asText); - //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 - var areaInfos = _roomInfo.DoorAreaInfos; - if (areaInfos.Count == 0) - { - areaInfos.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - } + // //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 + // var areaInfos = _roomInfo.DoorAreaInfos; + // if (areaInfos.Count == 0) + // { + // areaInfos.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); + // areaInfos.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); + // areaInfos.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); + // areaInfos.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); + // } } return _roomInfo; diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index aef8628..92600c3 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -60,6 +60,7 @@ public const string prefab_ui_MapEditorTools_tscn = "res://prefab/ui/MapEditorTools.tscn"; public const string prefab_ui_RoomUI_tscn = "res://prefab/ui/RoomUI.tscn"; public const string prefab_ui_Settlement_tscn = "res://prefab/ui/Settlement.tscn"; + public const string prefab_ui_TesetUi_tscn = "res://prefab/ui/TesetUi.tscn"; public const string prefab_weapon_Weapon0001_tscn = "res://prefab/weapon/Weapon0001.tscn"; public const string prefab_weapon_Weapon0002_tscn = "res://prefab/weapon/Weapon0002.tscn"; public const string prefab_weapon_Weapon0003_tscn = "res://prefab/weapon/Weapon0003.tscn"; @@ -176,6 +177,9 @@ public const string resource_sprite_ui_mapEditorProject_Back_png = "res://resource/sprite/ui/mapEditorProject/Back.png"; public const string resource_sprite_ui_mapEditorProject_CellBg_png = "res://resource/sprite/ui/mapEditorProject/CellBg.png"; public const string resource_sprite_ui_mapEditorProject_Search_png = "res://resource/sprite/ui/mapEditorProject/Search.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_down_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_down.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_hover_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png"; public const string resource_sprite_ui_roomUI_ChargeProgress_png = "res://resource/sprite/ui/roomUI/ChargeProgress.png"; public const string resource_sprite_ui_roomUI_ChargeProgressBar_png = "res://resource/sprite/ui/roomUI/ChargeProgressBar.png"; public const string resource_sprite_ui_roomUI_Cooldown_png = "res://resource/sprite/ui/roomUI/Cooldown.png"; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs index bdfa6f9..6e70d64 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs @@ -396,11 +396,11 @@ //MapEditorPanel.CallDelay(0.1f, OnClickCenterTool); CallDeferred(nameof(OnClickCenterTool)); - var doorPos = (_roomPosition + new Vector2I(_roomSize.X - 1, 1)) * GameConfig.TileCellSize; - MapEditorToolsPanel.CreateDoorTool( - doorPos, DoorDirection.E, - 0 * GameConfig.TileCellSize, 4 * GameConfig.TileCellSize - ); + // var doorPos = (_roomPosition + new Vector2I(_roomSize.X - 1, 1)) * GameConfig.TileCellSize; + // MapEditorToolsPanel.CreateDoorTool( + // doorPos, DoorDirection.E, + // 0 * GameConfig.TileCellSize, 4 * GameConfig.TileCellSize + // ); return true; } @@ -742,11 +742,75 @@ } } - public void Create_N_DoorArea() + /// <summary> + /// 创建地牢房间门区域 + /// </summary> + /// <param name="direction">门方向</param> + /// <param name="start">起始坐标, 单位: 像素</param> + /// <param name="end">结束坐标, 单位: 像素</param> + public DoorAreaInfo CreateDoorArea(DoorDirection direction, int start, int end) { - + var doorAreaInfo = new DoorAreaInfo(); + doorAreaInfo.Direction = direction; + doorAreaInfo.Start = start; + doorAreaInfo.End = end; + //doorAreaInfo.CalcPosition(_roomPosition, _roomSize); + _doorConfigs.Add(doorAreaInfo); + return doorAreaInfo; } + /// <summary> + /// 检测门区域数据是否可以提交 + /// </summary> + /// <param name="direction">门方向</param> + /// <param name="start">起始坐标, 单位: 像素</param> + /// <param name="end">结束坐标, 单位: 像素</param> + /// <returns></returns> + public bool CheckDoorArea(DoorDirection direction, int start, int end) + { + foreach (var item in _doorConfigs) + { + if (item.Direction == direction) + { + if (CheckValueCollision(item.Start, item.End, start, end)) + { + return false; + } + } + } + + return true; + } + + /// <summary> + /// 检测门区域数据是否可以提交 + /// </summary> + /// <param name="target">需要检测的门</param> + /// <param name="start">起始坐标, 单位: 像素</param> + /// <param name="end">结束坐标, 单位: 像素</param> + /// <returns></returns> + public bool CheckDoorArea(DoorAreaInfo target, int start, int end) + { + foreach (var item in _doorConfigs) + { + if (item.Direction == target.Direction && item != target) + { + if (CheckValueCollision(item.Start, item.End, start, end)) + { + return false; + } + } + } + + return true; + } + + private bool CheckValueCollision(float o1, float o2, float h1, float h2) + { + var size = GameConfig.TileCellSize; + return !(h2 < o1 - 3 * size || o2 + 3 * size < h1); + } + //保存房间配置 private void SaveRoomInfoConfig() { diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs index 0c8a697..e7dd3a2 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs @@ -13,6 +13,7 @@ _editorPanel = editorPanel; _editorTileMap.Instance.MapEditorPanel = editorPanel; _editorTileMap.Instance.MapEditorToolsPanel = editorPanel.S_MapEditorTools.Instance; + _editorTileMap.Instance.MapEditorToolsPanel.EditorMap = _editorTileMap; } public void OnShow() diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs index f1268a5..0a011ee 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs @@ -17,6 +17,16 @@ /// 朝向 /// </summary> public DoorDirection Direction { get; private set; } + + /// <summary> + /// 绑定的数据 + /// </summary> + public DoorAreaInfo DoorAreaInfo { get; set; } + + /// <summary> + /// 所属 Ui 对象 + /// </summary> + public MapEditorToolsPanel MapEditorToolsPanel { get; private set; } private DoorDragButton _startButton; private DoorDragButton _endButton; @@ -35,13 +45,14 @@ //是否是拖拽模式 private bool _isDragMode = false; //拖拽模式提交回调 - private Action<int, int> _onSubmit; + private Action<DoorDirection, int, int> _onSubmit; //拖拽模式取消时回调 private Action _onCancel; public void SetDoorDragAreaNode(MapEditorTools.DoorToolTemplate node) { _node = node; + MapEditorToolsPanel = (MapEditorToolsPanel)node.UiPanel; _defaultColor = _node.L_DoorArea.Instance.Color; _startButton = _node.L_StartBtn.Instance; _endButton = _node.L_EndBtn.Instance; @@ -69,7 +80,7 @@ if (_onSubmit != null) { var doorAreaRange = GetDoorAreaRange(); - _onSubmit(doorAreaRange.X, doorAreaRange.Y); + _onSubmit(Direction, doorAreaRange.X, doorAreaRange.Y); _onSubmit = null; } } @@ -126,7 +137,8 @@ /// <returns></returns> public Vector2I GetDoorAreaRange() { - return new Vector2I((int)(_startButton.Position.X + _startButton.Size.X), _areaSize); + var start = (int)(_startButton.Position.X + _startButton.Size.X); + return new Vector2I(start, start + _areaSize); } /// <summary> @@ -182,6 +194,7 @@ { if (dragState == DragState.DragStart) { + DoorHoverArea.IsDrag = true; _canComment = true; _startTempPos = _startButton.Position; _startDragRange = GetDoorAreaRange(); @@ -226,12 +239,23 @@ //区域必须大于等于 4 格宽度 if (areaSize >= GameConfig.TileCellSize * 4) { - if (!_canComment) + if (DoorAreaInfo == null) { + //可以提交 _canComment = true; _node.L_DoorArea.Instance.Color = _defaultColor; + return; } - return; + var doorAreaRange = GetDoorAreaRange(); + //检测是否撞到其他区域 + var checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y); + if (checkResult) + { + //可以提交 + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + return; + } } } @@ -244,12 +268,18 @@ } else { + DoorHoverArea.IsDrag = false; //松手后如果不能提交, 则还原初始位置 if (!_canComment) { _canComment = true; _node.L_DoorArea.Instance.Color = _defaultColor; - SetDoorAreaRange(_startDragRange.X, _startDragRange.Y); + SetDoorAreaRange(_startDragRange.X, _startDragRange.Y - _startDragRange.X); + } + else + { + //提交数据 + SubmitData(); } } } @@ -258,6 +288,7 @@ { if (dragState == DragState.DragStart) { + DoorHoverArea.IsDrag = true; _canComment = true; _endTempPos = _endButton.Position; _startDragRange = GetDoorAreaRange(); @@ -296,12 +327,23 @@ //区域必须大于等于 4 格宽度 if (areaSize >= GameConfig.TileCellSize * 4) { - if (!_canComment) + if (DoorAreaInfo == null) { + //可以提交 _canComment = true; _node.L_DoorArea.Instance.Color = _defaultColor; + return; } - return; + var doorAreaRange = GetDoorAreaRange(); + //检测是否撞到其他区域 + var checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y); + if (checkResult) + { + //可以提交 + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + return; + } } } @@ -314,12 +356,18 @@ } else { + DoorHoverArea.IsDrag = false; //松手后如果不能提交, 则还原初始位置 if (!_canComment) { _canComment = true; _node.L_DoorArea.Instance.Color = _defaultColor; - SetDoorAreaRange(_startDragRange.X, _startDragRange.Y); + SetDoorAreaRange(_startDragRange.X, _startDragRange.Y - _startDragRange.X); + } + else + { + //提交数据 + SubmitData(); } } } @@ -327,9 +375,9 @@ /// <summary> /// 将该区域变为拖拽模式, 用于创建门区域 /// </summary> - /// <param name="onSubmit">成功提交时回调, 参数1为起始点, 参数2为大小</param> + /// <param name="onSubmit">成功提交时回调, 参数1为方向, 参数2为起始点, 参数3为大小</param> /// <param name="onCancel">取消时调用</param> - public void MakeDragMode(Action<int, int> onSubmit, Action onCancel) + public void MakeDragMode(Action<DoorDirection, int, int> onSubmit, Action onCancel) { _canComment = false; _isDragMode = true; @@ -337,4 +385,17 @@ _onCancel = onCancel; _endButton.EmitSignal(BaseButton.SignalName.ButtonDown); } + + //提交数据 + private void SubmitData() + { + //保存数据 + if (DoorAreaInfo != null) + { + var doorAreaRange = GetDoorAreaRange(); + DoorAreaInfo.Start = doorAreaRange.X; + DoorAreaInfo.End = doorAreaRange.Y; + GD.Print("submit: " + doorAreaRange); + } + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs index 6025080..d1a7f91 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs @@ -4,6 +4,11 @@ public partial class DoorHoverArea : ColorRect { /// <summary> + /// 是否拖拽中 + /// </summary> + public static bool IsDrag { get; set; } + + /// <summary> /// 所属 Ui 对象 /// </summary> public MapEditorToolsPanel MapEditorToolsPanel { get; private set; } @@ -12,13 +17,11 @@ /// 房间门的朝向 /// </summary> public DoorDirection Direction { get; private set; } - /// <summary> - /// 是否拖拽中 - /// </summary> - public bool IsDrag { get; private set; } - + private bool _mouseHover; private Control _parent; + //当前正在拖拽创建的 DoorToolTemplate + private MapEditorTools.DoorToolTemplate _currToolTemplate; public override void _Ready() { @@ -29,6 +32,7 @@ public void Init(MapEditorToolsPanel panel, DoorDirection direction) { + IsDrag = false; MapEditorToolsPanel = panel; Direction = direction; } @@ -37,38 +41,51 @@ { if (_mouseHover && MapEditorToolsPanel.ActiveHoverArea == this) { - var start = Utils.Adsorption(_parent.GetLocalMousePosition().X, GameConfig.TileCellSize); - MapEditorToolsPanel.S_HoverPreviewRoot.Instance.Position = new Vector2(start, 0); - if (!IsDrag) { - if (Input.IsMouseButtonPressed(MouseButton.Left)) + var start = Utils.Adsorption(_parent.GetLocalMousePosition().X, GameConfig.TileCellSize); + var previewRoot = MapEditorToolsPanel.S_HoverPreviewRoot.Instance; + + //检测是否会与其他门发生碰撞 + var canCreateDragArea = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(Direction, start, start); + if (canCreateDragArea) { - GD.Print("开始..."); - IsDrag = true; - MapEditorToolsPanel.CreateDragDoorTool(_parent.Position, Direction, start, OnSubmitDoorArea); + previewRoot.Visible = true; + previewRoot.Position = new Vector2(start, 0); + + if (Input.IsMouseButtonPressed(MouseButton.Left)) + { + IsDrag = true; + _currToolTemplate = MapEditorToolsPanel.CreateDragDoorTool(_parent.Position, Direction, start, + OnSubmitDoorArea, OnCancelDoorArea); + } } - } - else - { - if (!Input.IsMouseButtonPressed(MouseButton.Left)) + else //发生碰撞, 不能提交 { - GD.Print("结束..."); - IsDrag = false; + previewRoot.Visible = false; } } } } //提交门区域 - private void OnSubmitDoorArea(int start, int end) + private void OnSubmitDoorArea(DoorDirection direction, int start, int end) { - GD.Print("提交区域: " + start + ", " + end); + IsDrag = false; + GD.Print("提交区域: " + direction + ", " + start + ", " + end); + _currToolTemplate.Instance.DoorAreaInfo = MapEditorToolsPanel.EditorMap.Instance.CreateDoorArea(direction, start, end); } - + + //取消提交 + private void OnCancelDoorArea() + { + IsDrag = false; + _currToolTemplate = null; + } + private void OnMouseEnter() { - if (MapEditorToolsPanel.ActiveHoverArea == null || !MapEditorToolsPanel.ActiveHoverArea.IsDrag) + if (MapEditorToolsPanel.ActiveHoverArea == null || !IsDrag) { _mouseHover = true; MapEditorToolsPanel.SetActiveHoverArea(this); @@ -77,7 +94,7 @@ private void OnMouseExit() { - if (MapEditorToolsPanel.ActiveHoverArea == null || !MapEditorToolsPanel.ActiveHoverArea.IsDrag) + if (MapEditorToolsPanel.ActiveHoverArea == null || !IsDrag) { _mouseHover = false; if (MapEditorToolsPanel.ActiveHoverArea == this) diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs index 4f6a3ea..652e86c 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs @@ -10,7 +10,12 @@ /// 鼠标悬停区域 /// </summary> public DoorHoverArea ActiveHoverArea { get; private set; } - + + /// <summary> + /// 所属编辑器Tile对象 + /// </summary> + public MapEditor.MapEditor.TileMap EditorMap { get; set; } + private List<DoorToolTemplate> _doorTools = new List<DoorToolTemplate>(); public override void OnCreateUi() @@ -34,7 +39,7 @@ public override void Process(float delta) { - S_HoverPreviewRoot.Instance.Visible = ActiveHoverArea != null && !ActiveHoverArea.IsDrag; + S_HoverPreviewRoot.Instance.Visible = ActiveHoverArea != null && !DoorHoverArea.IsDrag; } /// <summary> @@ -75,14 +80,21 @@ /// <param name="position">原点坐标, 单位: 像素</param> /// <param name="direction">方向</param> /// <param name="start">起始位置, 单位: 像素</param> - /// <param name="onSubmit">成功提交时回调, 参数1为起始点, 参数2为大小</param> - public void CreateDragDoorTool(Vector2 position, DoorDirection direction, int start, Action<int, int> onSubmit) + /// <param name="onSubmit">成功提交时回调, 参数1为方向, 参数2为起始点, 参数3为大小</param> + /// <param name="onCancel">取消提交时调用</param> + public DoorToolTemplate CreateDragDoorTool(Vector2 position, DoorDirection direction, int start, + Action<DoorDirection, int, int> onSubmit, Action onCancel) { var inst = CreateDoorToolInstance(); inst.Instance.SetDoorAreaPosition(position); inst.Instance.SetDoorAreaDirection(direction); inst.Instance.SetDoorAreaRange(start, 0); - inst.Instance.MakeDragMode(onSubmit, () => RemoveDoorTool(inst)); + inst.Instance.MakeDragMode(onSubmit, () => + { + RemoveDoorTool(inst); + onCancel(); + }); + return inst; } /// <summary>