diff --git a/DungeonShooting_ExcelTool/ExcelGenerator.cs b/DungeonShooting_ExcelTool/ExcelGenerator.cs index 2c96016..6ee11ed 100644 --- a/DungeonShooting_ExcelTool/ExcelGenerator.cs +++ b/DungeonShooting_ExcelTool/ExcelGenerator.cs @@ -168,22 +168,31 @@ hasRefColumn = true; if (mappingData.CollectionsType == CollectionsType.None) { - refColumnNoneCode += $" item.{columnName} = {mappingData.RefTypeName}_Map[item.__{columnName}];\n"; + refColumnNoneCode += $" if (!string.IsNullOrEmpty(item.__{columnName}))\n"; + refColumnNoneCode += $" {{\n"; + refColumnNoneCode += $" item.{columnName} = {mappingData.RefTypeName}_Map[item.__{columnName}];\n"; + refColumnNoneCode += $" }}\n"; } else if (mappingData.CollectionsType == CollectionsType.Array) { - refColumnNoneCode += $" item.{columnName} = new {mappingData.RefTypeName}[item.__{columnName}.Length];\n"; - refColumnNoneCode += $" for (var i = 0; i < item.__{columnName}.Length; i++)\n"; + refColumnNoneCode += $" if (item.__{columnName} != null)\n"; refColumnNoneCode += $" {{\n"; - refColumnNoneCode += $" item.{columnName}[i] = {mappingData.RefTypeName}_Map[item.__{columnName}[i]];\n"; + refColumnNoneCode += $" item.{columnName} = new {mappingData.RefTypeName}[item.__{columnName}.Length];\n"; + refColumnNoneCode += $" for (var i = 0; i < item.__{columnName}.Length; i++)\n"; + refColumnNoneCode += $" {{\n"; + refColumnNoneCode += $" item.{columnName}[i] = {mappingData.RefTypeName}_Map[item.__{columnName}[i]];\n"; + refColumnNoneCode += $" }}\n"; refColumnNoneCode += $" }}\n"; } else { - refColumnNoneCode += $" item.{columnName} = new {mappingData.RefTypeStr}();\n"; - refColumnNoneCode += $" foreach (var pair in item.__{columnName})\n"; + refColumnNoneCode += $" if (item.__{columnName} != null)\n"; refColumnNoneCode += $" {{\n"; - refColumnNoneCode += $" item.{columnName}.Add(pair.Key, {mappingData.RefTypeName}_Map[pair.Value]);\n"; + refColumnNoneCode += $" item.{columnName} = new {mappingData.RefTypeStr}();\n"; + refColumnNoneCode += $" foreach (var pair in item.__{columnName})\n"; + refColumnNoneCode += $" {{\n"; + refColumnNoneCode += $" item.{columnName}.Add(pair.Key, {mappingData.RefTypeName}_Map[pair.Value]);\n"; + refColumnNoneCode += $" }}\n"; refColumnNoneCode += $" }}\n"; } refColumnNoneCode += $"\n"; diff --git a/DungeonShooting_ExcelTool/excelFile/ActivityObject.xlsx b/DungeonShooting_ExcelTool/excelFile/ActivityObject.xlsx index b5ef62e..286ad1d 100644 --- a/DungeonShooting_ExcelTool/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_ExcelTool/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_ExcelTool/excelFile/Sound.xlsx b/DungeonShooting_ExcelTool/excelFile/Sound.xlsx new file mode 100644 index 0000000..4a5986a --- /dev/null +++ b/DungeonShooting_ExcelTool/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_ExcelTool/excelFile/Weapon.xlsx b/DungeonShooting_ExcelTool/excelFile/Weapon.xlsx index bd6cc04..8e77d9c 100644 --- a/DungeonShooting_ExcelTool/excelFile/Weapon.xlsx +++ b/DungeonShooting_ExcelTool/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/DungeonShooting.csproj b/DungeonShooting_Godot/DungeonShooting.csproj index 8e15ac5..4e093b1 100644 --- a/DungeonShooting_Godot/DungeonShooting.csproj +++ b/DungeonShooting_Godot/DungeonShooting.csproj @@ -1,4 +1,4 @@ - + net6.0 true diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old b/DungeonShooting_Godot/DungeonShooting.csproj.old new file mode 100644 index 0000000..8e15ac5 --- /dev/null +++ b/DungeonShooting_Godot/DungeonShooting.csproj.old @@ -0,0 +1,11 @@ + + + net6.0 + true + + + + + + + \ No newline at end of file diff --git a/DungeonShooting_Godot/default_bus_layout.tres b/DungeonShooting_Godot/default_bus_layout.tres index 60797cc..d877009 100644 --- a/DungeonShooting_Godot/default_bus_layout.tres +++ b/DungeonShooting_Godot/default_bus_layout.tres @@ -1,15 +1,15 @@ -[gd_resource type="AudioBusLayout" format=2] +[gd_resource type="AudioBusLayout" format=3 uid="uid://tqvsp0nnvq3k"] [resource] -bus/1/name = "BGM" +bus/1/name = &"BGM" bus/1/solo = false bus/1/mute = false bus/1/bypass_fx = false bus/1/volume_db = 0.0 -bus/1/send = "Master" -bus/2/name = "SFX" +bus/1/send = &"Master" +bus/2/name = &"SFX" bus/2/solo = false bus/2/mute = false bus/2/bypass_fx = false bus/2/volume_db = 0.0 -bus/2/send = "Master" +bus/2/send = &"Master" diff --git a/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.dll b/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.dll index 14ccd32..c2ed8e7 100644 --- a/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.dll +++ b/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.dll Binary files differ diff --git a/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.pdb b/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.pdb index ba5c905..3b1e68d 100644 --- a/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.pdb +++ b/DungeonShooting_Godot/excel/DungeonShooting_ExcelTool.pdb Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index e7f3499..3d87e7d 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx new file mode 100644 index 0000000..8564612 --- /dev/null +++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index 70d7bb4..e160783 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/resource/config/Sound.json b/DungeonShooting_Godot/resource/config/Sound.json new file mode 100644 index 0000000..b72a46c --- /dev/null +++ b/DungeonShooting_Godot/resource/config/Sound.json @@ -0,0 +1,38 @@ +[ + { + "Id": "shooting0001", + "Path": "res://resource/sound/sfx/Shooting0001.ogg", + "Volume": 15, + "Remark": "" + }, + { + "Id": "shooting0002", + "Path": "res://resource/sound/sfx/Shooting0001.ogg", + "Volume": 15, + "Remark": "" + }, + { + "Id": "shooting0003", + "Path": "res://resource/sound/sfx/Shooting0003.mp3", + "Volume": 0, + "Remark": "" + }, + { + "Id": "reloading0001", + "Path": "res://resource/sound/sfx/Reloading0001.mp3", + "Volume": 0, + "Remark": "" + }, + { + "Id": "reloading0002", + "Path": "res://resource/sound/sfx/Reloading0002.ogg", + "Volume": 0, + "Remark": "" + }, + { + "Id": "reloading0004", + "Path": "res://resource/sound/sfx/Reloading0004.ogg", + "Volume": 0, + "Remark": "" + } +] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index 71eebd0..c12d1ce 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -44,10 +44,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0002.mp3", - "ReloadSound": "", + "__ShootSound": "shooting0002", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "0002", "AiTargetLockingTime": 0, @@ -99,10 +99,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0002.mp3", - "ReloadSound": "", + "__ShootSound": "shooting0002", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.5, @@ -154,10 +154,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", - "ReloadSound": "", + "__ShootSound": "shooting0003", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "0004", "AiTargetLockingTime": 0, @@ -209,10 +209,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", - "ReloadSound": "", + "__ShootSound": "shooting0003", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.4, @@ -264,10 +264,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0001.ogg", - "ReloadSound": "res://resource/sound/sfx/Reloading0001.mp3", + "__ShootSound": "shooting0001", + "__ReloadSound": "reloading0001", "ReloadSoundDelayTime": 0.3, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "0006", "AiTargetLockingTime": 0, @@ -319,10 +319,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0001.ogg", - "ReloadSound": "res://resource/sound/sfx/Reloading0001.mp3", + "__ShootSound": "shooting0001", + "__ReloadSound": "reloading0001", "ReloadSoundDelayTime": 0.3, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 1, @@ -374,10 +374,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "", - "ReloadSound": "", + "__ShootSound": "", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "0008", "AiTargetLockingTime": 0, @@ -429,10 +429,10 @@ "X": 20, "Y": 15 }, - "ShootSound": "", - "ReloadSound": "", + "__ShootSound": "", + "__ReloadSound": "", "ReloadSoundDelayTime": 0, - "EquipSound": "", + "__EquipSound": "", "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.7, @@ -469,8 +469,8 @@ "StartScatteringRange": 3, "FinalScatteringRange": 60, "ScatteringRangeAddValue": 40, - "ScatteringRangeBackSpeed": 25, - "ScatteringRangeBackTime": 1, + "ScatteringRangeBackSpeed": 40, + "ScatteringRangeBackTime": 0, "MinDistance": 700, "MaxDistance": 900, "MinBacklash": 5, @@ -484,11 +484,11 @@ "X": 20, "Y": 15 }, - "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", - "ReloadSound": "res://resource/sound/sfx/Reloading0002.ogg", - "ReloadSoundDelayTime": 0.7, - "EquipSound": "res://resource/sound/sfx/Reloading0004.ogg", - "EquipSoundDelayTime": 0.3, + "__ShootSound": "shooting0003", + "__ReloadSound": "reloading0002", + "ReloadSoundDelayTime": 1.2, + "__EquipSound": "reloading0004", + "EquipSoundDelayTime": 0.7, "AiUseAttributeId": "", "AiTargetLockingTime": 0.6, "AiBulletSpeedScale": 0.7, diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 7a5c690..5cf1c4e 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_6b3q0"] +[sub_resource type="Image" id="Image_owtc2"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_6b3q0") +image = SubResource("Image_owtc2") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_6twnh"] +[sub_resource type="Image" id="Image_76r1w"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_6twnh") +image = SubResource("Image_76r1w") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_m5y4y"] +[sub_resource type="Image" id="Image_wpyue"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_m5y4y") +image = SubResource("Image_wpyue") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_767t4"] +[sub_resource type="Image" id="Image_a62up"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_767t4") +image = SubResource("Image_a62up") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_iykrc"] +[sub_resource type="Image" id="Image_urbg4"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_iykrc") +image = SubResource("Image_urbg4") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/config/ExcelConfig.cs b/DungeonShooting_Godot/src/config/ExcelConfig.cs index c3e4ed0..323bca9 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig.cs @@ -17,6 +17,15 @@ public static Dictionary ActivityObject_Map { get; private set; } /// + /// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// + public static List Sound_List { get; private set; } + /// + /// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// + public static Dictionary Sound_Map { get; private set; } + + /// /// Weapon.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// public static List Weapon_List { get; private set; } @@ -36,8 +45,10 @@ _init = true; _InitActivityObjectConfig(); + _InitSoundConfig(); _InitWeaponConfig(); + _InitWeaponRef(); } private static void _InitActivityObjectConfig() { @@ -57,12 +68,30 @@ throw new Exception("初始化表'ActivityObject'失败!"); } } + private static void _InitSoundConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/Sound.json"); + Sound_List = JsonSerializer.Deserialize>(text); + Sound_Map = new Dictionary(); + foreach (var item in Sound_List) + { + Sound_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'Sound'失败!"); + } + } private static void _InitWeaponConfig() { try { var text = _ReadConfigAsText("res://resource/config/Weapon.json"); - Weapon_List = JsonSerializer.Deserialize>(text); + Weapon_List = new List(JsonSerializer.Deserialize>(text)); Weapon_Map = new Dictionary(); foreach (var item in Weapon_List) { @@ -76,6 +105,35 @@ } } + private static void _InitWeaponRef() + { + foreach (Ref_Weapon item in Weapon_List) + { + try + { + if (!string.IsNullOrEmpty(item.__ShootSound)) + { + item.ShootSound = Sound_Map[item.__ShootSound]; + } + + if (!string.IsNullOrEmpty(item.__ReloadSound)) + { + item.ReloadSound = Sound_Map[item.__ReloadSound]; + } + + if (!string.IsNullOrEmpty(item.__EquipSound)) + { + item.EquipSound = Sound_Map[item.__EquipSound]; + } + + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化'Weapon'引用其他表数据失败, 当前行id: " + item.Id); + } + } + } private static string _ReadConfigAsText(string path) { var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs new file mode 100644 index 0000000..aacfceb --- /dev/null +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs @@ -0,0 +1,47 @@ +using System.Text.Json.Serialization; +using System.Collections.Generic; + +namespace Config; + +public static partial class ExcelConfig +{ + public class Sound + { + /// + /// 音效id + /// + [JsonInclude] + public string Id; + + /// + /// 文件路径 + /// + [JsonInclude] + public string Path; + + /// + /// 音量(建议范围:-80到+20) + /// + [JsonInclude] + public float Volume; + + /// + /// 备注 + /// + [JsonInclude] + public string Remark; + + /// + /// 返回浅拷贝出的新对象 + /// + public Sound Clone() + { + var inst = new Sound(); + inst.Id = Id; + inst.Path = Path; + inst.Volume = Volume; + inst.Remark = Remark; + return inst; + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index a2953d8..9fcba1f 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -259,14 +259,12 @@ /// /// 射击音效 /// - [JsonInclude] - public string ShootSound; + public Sound ShootSound; /// /// 换弹音效 /// - [JsonInclude] - public string ReloadSound; + public Sound ReloadSound; /// /// 换弹音效延时时间 @@ -277,8 +275,7 @@ /// /// 上膛音效 /// - [JsonInclude] - public string EquipSound; + public Sound EquipSound; /// /// 上膛音效延时时间 @@ -374,4 +371,16 @@ return inst; } } + private class Ref_Weapon : Weapon + { + [JsonInclude] + public string __ShootSound; + + [JsonInclude] + public string __ReloadSound; + + [JsonInclude] + public string __EquipSound; + + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs index 46bca47..79dfa72 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs @@ -9,16 +9,16 @@ protected override void OnReload() { //播放换弹音效 - if (!string.IsNullOrEmpty(Attribute.ReloadSound)) + if (Attribute.ReloadSound != null) { var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); if (Attribute.ReloadSoundDelayTime <= 0) { - SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound, position); + SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound.Path, position, Attribute.ReloadSound.Volume); } else { - SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound, position, Attribute.ReloadSoundDelayTime); + SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound.Path, position, Attribute.ReloadSoundDelayTime, Attribute.ReloadSound.Volume); } } } @@ -43,21 +43,21 @@ var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); //播放射击音效 - if (!string.IsNullOrEmpty(Attribute.ShootSound)) + if (Attribute.ShootSound != null) { - SoundManager.PlaySoundEffectPosition(Attribute.ShootSound, position, 0); + SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, Attribute.ShootSound.Volume); } //播放上膛音效 - if (!string.IsNullOrEmpty(Attribute.EquipSound)) + if (Attribute.EquipSound != null) { if (Attribute.EquipSoundDelayTime <= 0) { - SoundManager.PlaySoundEffectPosition(Attribute.EquipSound, position); + SoundManager.PlaySoundEffectPosition(Attribute.EquipSound.Path, position, Attribute.EquipSound.Volume); } else { - SoundManager.PlaySoundEffectPositionDelay(Attribute.EquipSound, position, Attribute.EquipSoundDelayTime); + SoundManager.PlaySoundEffectPositionDelay(Attribute.EquipSound.Path, position, Attribute.EquipSoundDelayTime, Attribute.EquipSound.Volume); } } }