补全 CombatNode 逻辑 + 重构 EnemyManager

- 添加了关卡内的难度系数与掉落
    - 难度系数:每循环一轮波次敌人血量翻倍
    - 道具掉落:按照掉落概率曲线根据波次计算当前爆率,并从新增的道具池里选择道具
    - `CombatResourceManager`:统一维护关卡内资源状态(硬币/金币/道具掉落)
- 重构 `EnemyManager`:
    - `EnemyManager`:编排子服务,不承载具体业务细节
    - `EnemySpawnDirector`:管理刷怪时序
    - `SpawnerResolver`:管理出生点与路径
    - `EnemyLifecycleTracker`:追踪敌人生命周期
    - `EnemyConfigService`:管理敌人配置与倍率
This commit is contained in:
SepComet
2026-03-02 17:23:34 +08:00
parent c576224991
commit 5ba94828a8
49 changed files with 1763 additions and 1047 deletions
@@ -1505,7 +1505,7 @@ MonoBehaviour:
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1
m_Elasticity: 0
m_Inertia: 1
m_DecelerationRate: 0.135
m_ScrollSensitivity: 1
@@ -459,6 +459,7 @@ MonoBehaviour:
_levelPhaseText: {fileID: 8225082572338647983}
_coinText: {fileID: 8462322658551354788}
_baseHpText: {fileID: 1807917018366299772}
_enemyHpRateText: {fileID: 205084553981986984}
_pauseButton: {fileID: 7428757802831321808}
_endButton: {fileID: 5538219017489576212}
--- !u!1 &7271289036404717568
@@ -629,6 +630,7 @@ RectTransform:
- {fileID: 1726761505281868741}
- {fileID: 4169170613063708458}
- {fileID: 1569478724942140920}
- {fileID: 5154404242222297291}
m_Father: {fileID: 8136671500363545760}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
@@ -662,6 +664,141 @@ MonoBehaviour:
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &7780165276013755249
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5154404242222297291}
- component: {fileID: 8116375402155163259}
- component: {fileID: 205084553981986984}
m_Layer: 5
m_Name: EnemyHpRateText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5154404242222297291
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7780165276013755249}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5356006041861078243}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8116375402155163259
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7780165276013755249}
m_CullTransparentMesh: 1
--- !u!114 &205084553981986984
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7780165276013755249}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u96BE\u5EA6\uFF1A2x"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2}
m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 50
m_fontSizeBase: 50
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8284139370021084558
GameObject:
m_ObjectHideFlags: 0
+24 -24
View File
@@ -842,12 +842,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -892,7 +892,7 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -140
value: -100
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -978,12 +978,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -1154,12 +1154,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -1204,7 +1204,7 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -335
value: -300
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -1417,22 +1417,22 @@ PrefabInstance:
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
@@ -1482,12 +1482,12 @@ PrefabInstance:
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 1030
value: -400
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 700
value: -100
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
@@ -1601,12 +1601,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -1819,7 +1819,7 @@ PrefabInstance:
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -600
value: -500
objectReference: {fileID: 0}
- target: {fileID: 4491355866364659447, guid: 2307f223279813546a43b221ddd496cc,
type: 3}
@@ -1933,12 +1933,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -1983,7 +1983,7 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -140
value: -100
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -2109,12 +2109,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
@@ -2285,12 +2285,12 @@ PrefabInstance:
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.x
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}
propertyPath: m_SizeDelta.y
value: 250
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7862994607866941546, guid: e40294c47302bf140a51489f95814532,
type: 3}