商店开发中

This commit is contained in:
小李xl 2024-03-30 13:42:58 +08:00
parent 865eb964de
commit 70af4f69e6
14 changed files with 360 additions and 258 deletions

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=13 format=3 uid="uid://b8s1dgu63fddf"] [gd_scene load_steps=13 format=3 uid="uid://b8s1dgu63fddf"]
[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/EnemyTemplate.tscn" id="1_2vqwe"] [ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_2vqwe"]
[ext_resource type="Script" path="res://src/game/activity/role/enemy/Enemy.cs" id="2_0pcq3"] [ext_resource type="Script" path="res://src/game/activity/role/enemy/Enemy.cs" id="2_0pcq3"]
[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="3_x8agd"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="3_x8agd"]
[ext_resource type="SpriteFrames" uid="uid://cnctpyrn02rhd" path="res://resource/spriteFrames/role/Enemy0001.tres" id="4_qv8w5"] [ext_resource type="SpriteFrames" uid="uid://cnctpyrn02rhd" path="res://resource/spriteFrames/role/Enemy0001.tres" id="4_qv8w5"]

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=13 format=3 uid="uid://daqsdld5gnwwr"] [gd_scene load_steps=13 format=3 uid="uid://daqsdld5gnwwr"]
[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/EnemyTemplate.tscn" id="1_fanet"] [ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_fanet"]
[ext_resource type="Script" path="res://src/game/activity/role/enemy/NoWeaponEnemy.cs" id="2_3an4s"] [ext_resource type="Script" path="res://src/game/activity/role/enemy/NoWeaponEnemy.cs" id="2_3an4s"]
[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="2_yunbp"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="2_yunbp"]
[ext_resource type="SpriteFrames" uid="uid://ctpkpxgcwb583" path="res://resource/spriteFrames/role/Enemy0002.tres" id="3_hbsqi"] [ext_resource type="SpriteFrames" uid="uid://ctpkpxgcwb583" path="res://resource/spriteFrames/role/Enemy0002.tres" id="3_hbsqi"]

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=7 format=3 uid="uid://dyl1dhtlxbcb3"]
[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_25fpq"]
[ext_resource type="Script" path="res://src/game/activity/role/shop/ShopBoss.cs" id="2_2ng7e"]
[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="2_7m501"]
[ext_resource type="SpriteFrames" uid="uid://bxn63xs3f87jy" path="res://resource/spriteFrames/role/ShopBoss0001.tres" id="3_b0a5c"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0nvxl"]
resource_local_to_scene = true
shader = ExtResource("2_7m501")
shader_parameter/blend = Color(0, 0, 0, 0.470588)
shader_parameter/schedule = 1.0
shader_parameter/modulate = Color(1, 1, 1, 1)
shader_parameter/show_outline = true
shader_parameter/outline_color = Color(0, 0, 0, 1)
shader_parameter/outline_rainbow = false
shader_parameter/outline_use_blend = true
shader_parameter/grey = 0.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_x86iq"]
resource_local_to_scene = true
shader = ExtResource("2_7m501")
shader_parameter/blend = Color(1, 1, 1, 1)
shader_parameter/schedule = 0.0
shader_parameter/modulate = Color(1, 1, 1, 1)
shader_parameter/show_outline = true
shader_parameter/outline_color = Color(0, 0, 0, 1)
shader_parameter/outline_rainbow = false
shader_parameter/outline_use_blend = true
shader_parameter/grey = 0.0
[node name="ShopBoss0001" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "FirePoint", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_25fpq")]
script = ExtResource("2_2ng7e")
ViewRay = NodePath("ViewRay")
NavigationAgent2D = NodePath("NavigationPoint/NavigationAgent2D")
NavigationPoint = NodePath("NavigationPoint")
FirePoint = NodePath("FirePoint")
HurtArea = NodePath("HurtArea")
HurtCollision = NodePath("HurtArea/HurtCollision")
InteractiveArea = NodePath("InteractiveArea")
InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision")
TipRoot = NodePath("TipRoot")
TipSprite = NodePath("TipRoot/TipSprite")
AnimationPlayer = NodePath("AnimationPlayer")
MountPoint = NodePath("MountPoint")
BackMountPoint = NodePath("BackMountPoint")
MeleeAttackArea = NodePath("MountPoint/MeleeAttackArea")
MeleeAttackCollision = NodePath("MountPoint/MeleeAttackArea/MeleeAttackCollision")
ShadowSprite = NodePath("ShadowSprite")
AnimatedSprite = NodePath("AnimatedSprite")
Collision = NodePath("Collision")
[node name="ShadowSprite" parent="." index="0"]
material = SubResource("ShaderMaterial_0nvxl")
[node name="AnimatedSprite" parent="." index="2"]
material = SubResource("ShaderMaterial_x86iq")
sprite_frames = ExtResource("3_b0a5c")

View File

@ -1,12 +1,11 @@
[gd_scene load_steps=5 format=3 uid="uid://dbrig6dq441wo"] [gd_scene load_steps=5 format=3 uid="uid://dbrig6dq441wo"]
[ext_resource type="PackedScene" uid="uid://cyrcv2jdgr8cf" path="res://prefab/role/template/RoleTemplate.tscn" id="1_5po38"] [ext_resource type="PackedScene" uid="uid://cyrcv2jdgr8cf" path="res://prefab/role/template/RoleTemplate.tscn" id="1_dbfvf"]
[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="3_x8agd"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xedx7"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_k8mt5"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_k8mt5"]
resource_local_to_scene = true resource_local_to_scene = true
shader = ExtResource("3_x8agd") shader = ExtResource("1_xedx7")
shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/blend = Color(1, 1, 1, 1)
shader_parameter/schedule = 0.0 shader_parameter/schedule = 0.0
shader_parameter/modulate = Color(1, 1, 1, 1) shader_parameter/modulate = Color(1, 1, 1, 1)
@ -19,7 +18,7 @@ shader_parameter/grey = 0.0
[sub_resource type="CircleShape2D" id="CircleShape2D_wu0xv"] [sub_resource type="CircleShape2D" id="CircleShape2D_wu0xv"]
radius = 8.06226 radius = 8.06226
[node name="EnemyTemplate" instance=ExtResource("1_5po38")] [node name="AiTemplate" instance=ExtResource("1_dbfvf")]
collision_layer = 16 collision_layer = 16
collision_mask = 25 collision_mask = 25
floor_stop_on_slope = false floor_stop_on_slope = false

View File

@ -1,13 +1,13 @@
[gd_scene load_steps=9 format=3 uid="uid://cyrcv2jdgr8cf"] [gd_scene load_steps=9 format=3 uid="uid://cyrcv2jdgr8cf"]
[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xk5yk"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xedx7"]
[ext_resource type="Script" path="res://src/game/activity/role/MountRotation.cs" id="2_5ddpw"] [ext_resource type="Script" path="res://src/framework/activity/hurt/HurtArea.cs" id="2_2eey0"]
[ext_resource type="Script" path="res://src/framework/activity/hurt/HurtArea.cs" id="2_8jnvr"] [ext_resource type="Script" path="res://src/game/activity/role/MountRotation.cs" id="3_1jj1i"]
[ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="3_bo78w"] [ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="4_kn7in"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_yif6x"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_yif6x"]
resource_local_to_scene = true resource_local_to_scene = true
shader = ExtResource("1_xk5yk") shader = ExtResource("1_xedx7")
shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/blend = Color(1, 1, 1, 1)
shader_parameter/schedule = 0.0 shader_parameter/schedule = 0.0
shader_parameter/modulate = Color(1, 1, 1, 1) shader_parameter/modulate = Color(1, 1, 1, 1)
@ -49,7 +49,7 @@ shape = SubResource("CircleShape2D_5pj80")
collision_layer = 0 collision_layer = 0
collision_mask = 0 collision_mask = 0
monitoring = false monitoring = false
script = ExtResource("2_8jnvr") script = ExtResource("2_2eey0")
[node name="HurtCollision" type="CollisionShape2D" parent="HurtArea"] [node name="HurtCollision" type="CollisionShape2D" parent="HurtArea"]
position = Vector2(0, -9) position = Vector2(0, -9)
@ -66,7 +66,7 @@ shape = SubResource("CapsuleShape2D_843d5")
[node name="MountPoint" type="Marker2D" parent="."] [node name="MountPoint" type="Marker2D" parent="."]
position = Vector2(2, -8) position = Vector2(2, -8)
script = ExtResource("2_5ddpw") script = ExtResource("3_1jj1i")
[node name="MeleeAttackArea" type="Area2D" parent="MountPoint"] [node name="MeleeAttackArea" type="Area2D" parent="MountPoint"]
visible = false visible = false
@ -81,6 +81,6 @@ monitorable = false
[node name="TipSprite" type="AnimatedSprite2D" parent="TipRoot"] [node name="TipSprite" type="AnimatedSprite2D" parent="TipRoot"]
visible = false visible = false
position = Vector2(0, -22) position = Vector2(0, -22)
sprite_frames = ExtResource("3_bo78w") sprite_frames = ExtResource("4_kn7in")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]

View File

@ -31,7 +31,7 @@ project/assembly_name="DungeonShooting"
[editor_plugins] [editor_plugins]
enabled=PackedStringArray() enabled=PackedStringArray("res://addons/dungeonShooting_plugin/plugin.cfg")
[file_customization] [file_customization]

View File

@ -23,7 +23,7 @@
"Details": "", "Details": "",
"IsStatic": false, "IsStatic": false,
"__Material": "", "__Material": "",
"Prefab": "res://prefab/role/Enemy0001.tscn", "Prefab": "res://prefab/role/enemy/Enemy0001.tscn",
"Icon": "res://resource/sprite/role/enemy0001/enemy0001_Icon.png", "Icon": "res://resource/sprite/role/enemy0001/enemy0001_Icon.png",
"ShowInMapEditor": true "ShowInMapEditor": true
}, },
@ -37,10 +37,24 @@
"Details": "", "Details": "",
"IsStatic": false, "IsStatic": false,
"__Material": "", "__Material": "",
"Prefab": "res://prefab/role/Enemy0002.tscn", "Prefab": "res://prefab/role/enemy/Enemy0002.tscn",
"Icon": "res://resource/sprite/role/enemy0002/Enemy0002.png", "Icon": "res://resource/sprite/role/enemy0002/Enemy0002.png",
"ShowInMapEditor": true "ShowInMapEditor": true
}, },
{
"Id": "shopBoss0001",
"Name": "\u5546\u5E97\u8001\u677F",
"Type": 4,
"Quality": 0,
"Price": 0,
"Intro": "\u5546\u5E97\u8001\u677F",
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/role/shopBoss/ShopBoss0001.tscn",
"Icon": "res://resource/sprite/role/shopBoss0001/ShopBoss0001.png",
"ShowInMapEditor": true
},
{ {
"Id": "weapon0001", "Id": "weapon0001",
"Name": "\u6B65\u67AA", "Name": "\u6B65\u67AA",

View File

@ -0,0 +1,14 @@
[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://bxn63xs3f87jy"]
[ext_resource type="Texture2D" uid="uid://cfgdtj2quumhy" path="res://resource/sprite/role/shopBoss0001/ShopBoss0001.png" id="1_k2gly"]
[resource]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_k2gly")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

View File

@ -121,7 +121,7 @@ DefaultLayer = 1
ShowOffset = Vector2(2.08165e-12, 2) ShowOffset = Vector2(2.08165e-12, 2)
CollisionVisible = false CollisionVisible = false
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0006" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0006" index="0"]
position = Vector2(-11, -3) position = Vector2(-11, -3)
texture = ExtResource("7_30qwa") texture = ExtResource("7_30qwa")
@ -133,7 +133,7 @@ DefaultLayer = 1
ShowOffset = Vector2(2.08165e-12, 2) ShowOffset = Vector2(2.08165e-12, 2)
CollisionVisible = false CollisionVisible = false
[node name="ActivityInstance" type="Node2D" parent="ItemRoot/Item0008" index="1"] [node name="ActivityInstance" type="Node2D" parent="ItemRoot/Item0008" index="0"]
position = Vector2(2.5, -12) position = Vector2(2.5, -12)
script = ExtResource("5_lowqi") script = ExtResource("5_lowqi")
Id = "item_0031" Id = "item_0031"
@ -149,7 +149,7 @@ DefaultLayer = 1
ShowOffset = Vector2(2.08165e-12, 2) ShowOffset = Vector2(2.08165e-12, 2)
CollisionVisible = false CollisionVisible = false
[node name="Item26" type="Sprite2D" parent="ItemRoot/Item0013" index="1"] [node name="Item26" type="Sprite2D" parent="ItemRoot/Item0013" index="0"]
position = Vector2(18, -2) position = Vector2(18, -2)
texture = ExtResource("8_61dkg") texture = ExtResource("8_61dkg")
@ -161,19 +161,19 @@ DefaultLayer = 1
ShowOffset = Vector2(2.08165e-12, 2) ShowOffset = Vector2(2.08165e-12, 2)
CollisionVisible = false CollisionVisible = false
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0017" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0017" index="0"]
position = Vector2(-2, -13) position = Vector2(-2, -13)
texture = ExtResource("8_u3vry") texture = ExtResource("8_u3vry")
[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0017" index="2"] [node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0017" index="1"]
position = Vector2(18, -11) position = Vector2(18, -11)
texture = ExtResource("9_lhdr8") texture = ExtResource("9_lhdr8")
[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0017" index="3"] [node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0017" index="2"]
position = Vector2(-16, -2) position = Vector2(-16, -2)
texture = ExtResource("10_4eqn0") texture = ExtResource("10_4eqn0")
[node name="Sprite2D4" type="Sprite2D" parent="ItemRoot/Item0017" index="4"] [node name="Sprite2D4" type="Sprite2D" parent="ItemRoot/Item0017" index="3"]
position = Vector2(10, -1) position = Vector2(10, -1)
texture = ExtResource("11_tg3jo") texture = ExtResource("11_tg3jo")
@ -201,12 +201,12 @@ Id = "item_0002"
DefaultLayer = 1 DefaultLayer = 1
CollisionVisible = false CollisionVisible = false
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0002" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0002" index="0"]
position = Vector2(133, 114) position = Vector2(133, 114)
rotation = 1.5708 rotation = 1.5708
texture = ExtResource("12_agfji") texture = ExtResource("12_agfji")
[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0002" index="2"] [node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0002" index="1"]
material = SubResource("ShaderMaterial_i7git") material = SubResource("ShaderMaterial_i7git")
position = Vector2(0, -18) position = Vector2(0, -18)
scale = Vector2(1, -1) scale = Vector2(1, -1)
@ -227,7 +227,7 @@ ShadowZIndex = 0
VerticalMotion = false VerticalMotion = false
CollisionVisible = false CollisionVisible = false
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0004" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0004" index="0"]
position = Vector2(71, -37) position = Vector2(71, -37)
texture = ExtResource("13_unnpl") texture = ExtResource("13_unnpl")
@ -263,15 +263,15 @@ script = ExtResource("5_lowqi")
Id = "item_0009" Id = "item_0009"
DefaultLayer = 1 DefaultLayer = 1
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0009" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0009" index="0"]
position = Vector2(-24, -10) position = Vector2(-24, -10)
texture = ExtResource("15_h7524") texture = ExtResource("15_h7524")
[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0009" index="2"] [node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0009" index="1"]
position = Vector2(1, -10) position = Vector2(1, -10)
texture = ExtResource("15_h7524") texture = ExtResource("15_h7524")
[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0009" index="3"] [node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0009" index="2"]
position = Vector2(37, -10) position = Vector2(37, -10)
texture = ExtResource("15_h7524") texture = ExtResource("15_h7524")
@ -305,7 +305,7 @@ script = ExtResource("5_lowqi")
Id = "item_0015" Id = "item_0015"
DefaultLayer = 1 DefaultLayer = 1
[node name="Slice04" type="Sprite2D" parent="ItemRoot/Item0015" index="1"] [node name="Slice04" type="Sprite2D" parent="ItemRoot/Item0015" index="0"]
position = Vector2(16, -9) position = Vector2(16, -9)
texture = ExtResource("15_h7524") texture = ExtResource("15_h7524")
@ -328,11 +328,11 @@ script = ExtResource("5_lowqi")
Id = "item_0019" Id = "item_0019"
DefaultLayer = 1 DefaultLayer = 1
[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0019" index="1"] [node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0019" index="0"]
position = Vector2(-20, -9) position = Vector2(-20, -9)
texture = ExtResource("16_xj0e1") texture = ExtResource("16_xj0e1")
[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0019" index="2"] [node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0019" index="1"]
position = Vector2(17, -8) position = Vector2(17, -8)
texture = ExtResource("17_gwwce") texture = ExtResource("17_gwwce")

View File

@ -8,22 +8,31 @@ namespace Config;
public static partial class ExcelConfig public static partial class ExcelConfig
{ {
/// <summary> /// <summary>
/// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary> /// </summary>
public static List<ActivePropBase> ActivePropBase_List { get; private set; } public static List<BuffPropBase> BuffPropBase_List { get; private set; }
/// <summary> /// <summary>
/// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id /// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary> /// </summary>
public static Dictionary<string, ActivePropBase> ActivePropBase_Map { get; private set; } public static Dictionary<string, BuffPropBase> BuffPropBase_Map { get; private set; }
/// <summary> /// <summary>
/// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary> /// </summary>
public static List<ActivityBase> ActivityBase_List { get; private set; } public static List<Sound> Sound_List { get; private set; }
/// <summary> /// <summary>
/// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id /// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary> /// </summary>
public static Dictionary<string, ActivityBase> ActivityBase_Map { get; private set; } public static Dictionary<string, Sound> Sound_Map { get; private set; }
/// <summary>
/// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<WeaponBase> WeaponBase_List { get; private set; }
/// <summary>
/// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, WeaponBase> WeaponBase_Map { get; private set; }
/// <summary> /// <summary>
/// ActivityMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// ActivityMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
@ -43,15 +52,6 @@ public static partial class ExcelConfig
/// </summary> /// </summary>
public static Dictionary<string, AiAttackAttr> AiAttackAttr_Map { get; private set; } public static Dictionary<string, AiAttackAttr> AiAttackAttr_Map { get; private set; }
/// <summary>
/// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<BuffPropBase> BuffPropBase_List { get; private set; }
/// <summary>
/// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, BuffPropBase> BuffPropBase_Map { get; private set; }
/// <summary> /// <summary>
/// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary> /// </summary>
@ -61,6 +61,15 @@ public static partial class ExcelConfig
/// </summary> /// </summary>
public static Dictionary<string, BulletBase> BulletBase_Map { get; private set; } public static Dictionary<string, BulletBase> BulletBase_Map { get; private set; }
/// <summary>
/// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<ActivePropBase> ActivePropBase_List { get; private set; }
/// <summary>
/// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, ActivePropBase> ActivePropBase_Map { get; private set; }
/// <summary> /// <summary>
/// EnemyBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// EnemyBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary> /// </summary>
@ -70,6 +79,15 @@ public static partial class ExcelConfig
/// </summary> /// </summary>
public static Dictionary<string, EnemyBase> EnemyBase_Map { get; private set; } public static Dictionary<string, EnemyBase> EnemyBase_Map { get; private set; }
/// <summary>
/// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<ActivityBase> ActivityBase_List { get; private set; }
/// <summary>
/// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, ActivityBase> ActivityBase_Map { get; private set; }
/// <summary> /// <summary>
/// LiquidMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// LiquidMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary> /// </summary>
@ -79,24 +97,6 @@ public static partial class ExcelConfig
/// </summary> /// </summary>
public static Dictionary<string, LiquidMaterial> LiquidMaterial_Map { get; private set; } public static Dictionary<string, LiquidMaterial> LiquidMaterial_Map { get; private set; }
/// <summary>
/// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<Sound> Sound_List { get; private set; }
/// <summary>
/// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, Sound> Sound_Map { get; private set; }
/// <summary>
/// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<WeaponBase> WeaponBase_List { get; private set; }
/// <summary>
/// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, WeaponBase> WeaponBase_Map { get; private set; }
private static bool _init = false; private static bool _init = false;
/// <summary> /// <summary>
@ -107,94 +107,22 @@ public static partial class ExcelConfig
if (_init) return; if (_init) return;
_init = true; _init = true;
_InitActivePropBaseConfig();
_InitActivityBaseConfig();
_InitActivityMaterialConfig();
_InitAiAttackAttrConfig();
_InitBuffPropBaseConfig(); _InitBuffPropBaseConfig();
_InitBulletBaseConfig();
_InitEnemyBaseConfig();
_InitLiquidMaterialConfig();
_InitSoundConfig(); _InitSoundConfig();
_InitWeaponBaseConfig(); _InitWeaponBaseConfig();
_InitActivityMaterialConfig();
_InitAiAttackAttrConfig();
_InitBulletBaseConfig();
_InitActivePropBaseConfig();
_InitEnemyBaseConfig();
_InitActivityBaseConfig();
_InitLiquidMaterialConfig();
_InitActivePropBaseRef();
_InitActivityBaseRef();
_InitBuffPropBaseRef(); _InitBuffPropBaseRef();
_InitEnemyBaseRef();
_InitWeaponBaseRef(); _InitWeaponBaseRef();
} _InitActivePropBaseRef();
private static void _InitActivePropBaseConfig() _InitEnemyBaseRef();
{ _InitActivityBaseRef();
try
{
var text = _ReadConfigAsText("res://resource/config/ActivePropBase.json");
ActivePropBase_List = new List<ActivePropBase>(JsonSerializer.Deserialize<List<Ref_ActivePropBase>>(text));
ActivePropBase_Map = new Dictionary<string, ActivePropBase>();
foreach (var item in ActivePropBase_List)
{
ActivePropBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'ActivePropBase'失败!");
}
}
private static void _InitActivityBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/ActivityBase.json");
ActivityBase_List = new List<ActivityBase>(JsonSerializer.Deserialize<List<Ref_ActivityBase>>(text));
ActivityBase_Map = new Dictionary<string, ActivityBase>();
foreach (var item in ActivityBase_List)
{
ActivityBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'ActivityBase'失败!");
}
}
private static void _InitActivityMaterialConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/ActivityMaterial.json");
ActivityMaterial_List = JsonSerializer.Deserialize<List<ActivityMaterial>>(text);
ActivityMaterial_Map = new Dictionary<string, ActivityMaterial>();
foreach (var item in ActivityMaterial_List)
{
ActivityMaterial_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'ActivityMaterial'失败!");
}
}
private static void _InitAiAttackAttrConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/AiAttackAttr.json");
AiAttackAttr_List = JsonSerializer.Deserialize<List<AiAttackAttr>>(text);
AiAttackAttr_Map = new Dictionary<string, AiAttackAttr>();
foreach (var item in AiAttackAttr_List)
{
AiAttackAttr_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'AiAttackAttr'失败!");
}
} }
private static void _InitBuffPropBaseConfig() private static void _InitBuffPropBaseConfig()
{ {
@ -214,60 +142,6 @@ public static partial class ExcelConfig
throw new Exception("初始化表'BuffPropBase'失败!"); throw new Exception("初始化表'BuffPropBase'失败!");
} }
} }
private static void _InitBulletBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/BulletBase.json");
BulletBase_List = JsonSerializer.Deserialize<List<BulletBase>>(text);
BulletBase_Map = new Dictionary<string, BulletBase>();
foreach (var item in BulletBase_List)
{
BulletBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'BulletBase'失败!");
}
}
private static void _InitEnemyBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/EnemyBase.json");
EnemyBase_List = new List<EnemyBase>(JsonSerializer.Deserialize<List<Ref_EnemyBase>>(text));
EnemyBase_Map = new Dictionary<string, EnemyBase>();
foreach (var item in EnemyBase_List)
{
EnemyBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'EnemyBase'失败!");
}
}
private static void _InitLiquidMaterialConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/LiquidMaterial.json");
LiquidMaterial_List = JsonSerializer.Deserialize<List<LiquidMaterial>>(text);
LiquidMaterial_Map = new Dictionary<string, LiquidMaterial>();
foreach (var item in LiquidMaterial_List)
{
LiquidMaterial_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'LiquidMaterial'失败!");
}
}
private static void _InitSoundConfig() private static void _InitSoundConfig()
{ {
try try
@ -304,45 +178,133 @@ public static partial class ExcelConfig
throw new Exception("初始化表'WeaponBase'失败!"); throw new Exception("初始化表'WeaponBase'失败!");
} }
} }
private static void _InitActivityMaterialConfig()
private static void _InitActivePropBaseRef()
{ {
foreach (Ref_ActivePropBase item in ActivePropBase_List) try
{ {
try var text = _ReadConfigAsText("res://resource/config/ActivityMaterial.json");
ActivityMaterial_List = JsonSerializer.Deserialize<List<ActivityMaterial>>(text);
ActivityMaterial_Map = new Dictionary<string, ActivityMaterial>();
foreach (var item in ActivityMaterial_List)
{ {
if (!string.IsNullOrEmpty(item.__Activity)) ActivityMaterial_Map.Add(item.Id, item);
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id);
} }
} }
} catch (Exception e)
private static void _InitActivityBaseRef()
{
foreach (Ref_ActivityBase item in ActivityBase_List)
{ {
try GD.PrintErr(e.ToString());
{ throw new Exception("初始化表'ActivityMaterial'失败!");
if (!string.IsNullOrEmpty(item.__Material))
{
item.Material = ActivityMaterial_Map[item.__Material];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'ActivityBase'引用其他表数据失败, 当前行id: " + item.Id);
}
} }
} }
private static void _InitAiAttackAttrConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/AiAttackAttr.json");
AiAttackAttr_List = JsonSerializer.Deserialize<List<AiAttackAttr>>(text);
AiAttackAttr_Map = new Dictionary<string, AiAttackAttr>();
foreach (var item in AiAttackAttr_List)
{
AiAttackAttr_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'AiAttackAttr'失败!");
}
}
private static void _InitBulletBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/BulletBase.json");
BulletBase_List = JsonSerializer.Deserialize<List<BulletBase>>(text);
BulletBase_Map = new Dictionary<string, BulletBase>();
foreach (var item in BulletBase_List)
{
BulletBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'BulletBase'失败!");
}
}
private static void _InitActivePropBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/ActivePropBase.json");
ActivePropBase_List = new List<ActivePropBase>(JsonSerializer.Deserialize<List<Ref_ActivePropBase>>(text));
ActivePropBase_Map = new Dictionary<string, ActivePropBase>();
foreach (var item in ActivePropBase_List)
{
ActivePropBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'ActivePropBase'失败!");
}
}
private static void _InitEnemyBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/EnemyBase.json");
EnemyBase_List = new List<EnemyBase>(JsonSerializer.Deserialize<List<Ref_EnemyBase>>(text));
EnemyBase_Map = new Dictionary<string, EnemyBase>();
foreach (var item in EnemyBase_List)
{
EnemyBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'EnemyBase'失败!");
}
}
private static void _InitActivityBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/ActivityBase.json");
ActivityBase_List = new List<ActivityBase>(JsonSerializer.Deserialize<List<Ref_ActivityBase>>(text));
ActivityBase_Map = new Dictionary<string, ActivityBase>();
foreach (var item in ActivityBase_List)
{
ActivityBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'ActivityBase'失败!");
}
}
private static void _InitLiquidMaterialConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/LiquidMaterial.json");
LiquidMaterial_List = JsonSerializer.Deserialize<List<LiquidMaterial>>(text);
LiquidMaterial_Map = new Dictionary<string, LiquidMaterial>();
foreach (var item in LiquidMaterial_List)
{
LiquidMaterial_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'LiquidMaterial'失败!");
}
}
private static void _InitBuffPropBaseRef() private static void _InitBuffPropBaseRef()
{ {
foreach (Ref_BuffPropBase item in BuffPropBase_List) foreach (Ref_BuffPropBase item in BuffPropBase_List)
@ -362,25 +324,6 @@ public static partial class ExcelConfig
} }
} }
} }
private static void _InitEnemyBaseRef()
{
foreach (Ref_EnemyBase item in EnemyBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Activity))
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'EnemyBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static void _InitWeaponBaseRef() private static void _InitWeaponBaseRef()
{ {
foreach (Ref_WeaponBase item in WeaponBase_List) foreach (Ref_WeaponBase item in WeaponBase_List)
@ -449,6 +392,63 @@ public static partial class ExcelConfig
} }
} }
} }
private static void _InitActivePropBaseRef()
{
foreach (Ref_ActivePropBase item in ActivePropBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Activity))
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static void _InitEnemyBaseRef()
{
foreach (Ref_EnemyBase item in EnemyBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Activity))
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'EnemyBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static void _InitActivityBaseRef()
{
foreach (Ref_ActivityBase item in ActivityBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Material))
{
item.Material = ActivityMaterial_Map[item.__Material];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'ActivityBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static string _ReadConfigAsText(string path) private static string _ReadConfigAsText(string path)
{ {
var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); var file = FileAccess.Open(path, FileAccess.ModeFlags.Read);

View File

@ -14,9 +14,18 @@ public partial class ActivityObject
{ {
throw new Exception("实例化 ActivityObject 前请先调用 'GameApplication.Instance.DungeonManager.CreateNewWorld()' 初始化 World 对象"); throw new Exception("实例化 ActivityObject 前请先调用 'GameApplication.Instance.DungeonManager.CreateNewWorld()' 初始化 World 对象");
} }
var instance = ResourceManager.LoadAndInstantiate<ActivityObject>(config.Prefab);
instance._InitNode(config, world); try
return instance; {
var instance = ResourceManager.LoadAndInstantiate<ActivityObject>(config.Prefab);
instance._InitNode(config, world);
return instance;
}
catch (Exception e)
{
Debug.LogError($"创建实例'{config.Id}'失败, 错误信息: {e.Message}\n{e.StackTrace}");
throw;
}
} }
/// <summary> /// <summary>

View File

@ -24,6 +24,11 @@ public partial class ActivityObject
/// </summary> /// </summary>
public const string Id_enemy0002 = "enemy0002"; public const string Id_enemy0002 = "enemy0002";
/// <summary> /// <summary>
/// 名称: 商店老板 <br/>
/// 简介: 商店老板
/// </summary>
public const string Id_shopBoss0001 = "shopBoss0001";
/// <summary>
/// 名称: 步枪 <br/> /// 名称: 步枪 <br/>
/// 简介: /// 简介:
/// </summary> /// </summary>

View File

@ -229,6 +229,9 @@ public class RoomPreinstall : IDestroy
mark.Id = ActivityObject.Ids.Id_treasure_box0001; mark.Id = ActivityObject.Ids.Id_treasure_box0001;
mark.ActivityType = ActivityType.Treasure; mark.ActivityType = ActivityType.Treasure;
mark.Altitude = 0; mark.Altitude = 0;
// mark.Id = ActivityObject.Ids.Id_shopBoss0001;
// mark.ActivityType = ActivityType.Enemy;
} }
private void HandlerTreasureMark(World world, MarkInfo markInfo, ActivityMark mark) private void HandlerTreasureMark(World world, MarkInfo markInfo, ActivityMark mark)