181404010226 il y a 2 mois
Parent
commit
700b8f1edc
36 fichiers modifiés avec 2207 ajouts et 281 suppressions
  1. 2 2
      assets/Scenes/GameLevel.scene
  2. 9 0
      assets/data/backups/levels.meta
  3. 116 0
      assets/data/backups/levels/Level1_20250919_113116.json
  4. 11 0
      assets/data/backups/levels/Level1_20250919_113116.json.meta
  5. 172 0
      assets/data/backups/levels/Level2_20250919_113116.json
  6. 11 0
      assets/data/backups/levels/Level2_20250919_113116.json.meta
  7. 234 0
      assets/data/backups/levels/Level3_20250919_113116.json
  8. 11 0
      assets/data/backups/levels/Level3_20250919_113116.json.meta
  9. 476 0
      assets/data/backups/levels/Level4_20250919_113116.json
  10. 11 0
      assets/data/backups/levels/Level4_20250919_113116.json.meta
  11. 118 0
      assets/data/backups/levels/Level5_20250919_113116.json
  12. 11 0
      assets/data/backups/levels/Level5_20250919_113116.json.meta
  13. 119 0
      assets/data/backups/levels/Level6_20250919_113116.json
  14. 11 0
      assets/data/backups/levels/Level6_20250919_113116.json.meta
  15. 57 0
      assets/data/backups/levels/Level7_20250919_113116.json
  16. 11 0
      assets/data/backups/levels/Level7_20250919_113116.json.meta
  17. 154 0
      assets/data/backups/levels/Level8_20250919_113116.json
  18. 11 0
      assets/data/backups/levels/Level8_20250919_113116.json.meta
  19. 174 0
      assets/data/backups/levels/Level9_20250919_113116.json
  20. 11 0
      assets/data/backups/levels/Level9_20250919_113116.json.meta
  21. 24 17
      assets/scripts/AudioManager/AudioManager.ts
  22. 31 11
      assets/scripts/CombatSystem/BlockManager.ts
  23. 14 12
      assets/scripts/CombatSystem/EnemyInstance.ts
  24. 12 6
      assets/scripts/CombatSystem/SkillSelection/SkillSelectionController.ts
  25. 17 15
      assets/scripts/CombatSystem/WeaponBullet.ts
  26. 177 0
      assets/scripts/Core/BundleLoader.ts
  27. 9 0
      assets/scripts/Core/BundleLoader.ts.meta
  28. 54 64
      assets/scripts/Core/ConfigManager.ts
  29. 16 22
      assets/scripts/Core/LevelSessionManager.ts
  30. 15 13
      assets/scripts/FourUI/SkillSystem/SkillConfigManager.ts
  31. 15 13
      assets/scripts/FourUI/UpgradeSystem/UpgradeAni.ts
  32. 45 44
      assets/scripts/FourUI/UpgradeSystem/UpgradeController.ts
  33. 31 48
      assets/scripts/LevelSystem/BackgroundManager.ts
  34. 3 3
      assets/scripts/LevelSystem/GameManager.ts
  35. 6 4
      assets/scripts/LevelSystem/IN_game.ts
  36. 8 7
      assets/scripts/LevelSystem/SaveDataManager.ts

+ 2 - 2
assets/Scenes/GameLevel.scene

@@ -31005,7 +31005,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 11.744140624999998,
+      "x": 11.744140625000002,
       "y": 0,
       "z": 0
     },
@@ -31132,7 +31132,7 @@
     "_right": 0,
     "_top": 4.062999999999998,
     "_bottom": 0.37195384615384625,
-    "_horizontalCenter": 0.06382685122282608,
+    "_horizontalCenter": 0.0638268512228261,
     "_verticalCenter": 0,
     "_isAbsLeft": true,
     "_isAbsRight": true,

+ 9 - 0
assets/data/backups/levels.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "7539d626-ee80-4a10-b7eb-ab066792bdf9",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 116 - 0
assets/data/backups/levels/Level1_20250919_113116.json

@@ -0,0 +1,116 @@
+{
+  "levelId": "Level1",
+  "name": "新手关卡(草地平原)",
+  "scene": "grassland",
+  "description": "新手引导关卡,学习基础塔防玩法",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手"
+  ],
+  "coinReward": 300,
+  "diamondReward": 20,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.0,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 15,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 30.0,
+          "characteristics": "中速移动, 无技能"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level1_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "491b975d-25e8-4852-9ac8-9a3175a595ee",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 172 - 0
assets/data/backups/levels/Level2_20250919_113116.json

@@ -0,0 +1,172 @@
+{
+  "levelId": "Level2",
+  "name": "丛林冒险(森林场景)",
+  "scene": "forest",
+  "description": "森林场景的塔防挑战,引入新的敌人类型和武器组合",
+  "backgroundImage": "images/LevelBackground/BG2",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜"
+  ],
+  "coinReward": 500,
+  "diamondReward": 30,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.2,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 5,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 15,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 8,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 30,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 10.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 10,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 6,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "boss1_gatekeeper",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 多种攻击方式, 召唤小怪"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 5,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level2_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "091b3224-53c2-4c96-90ae-069aa51a1455",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 234 - 0
assets/data/backups/levels/Level3_20250919_113116.json

@@ -0,0 +1,234 @@
+{
+  "levelId": "Level3",
+  "name": "魔法废墟(魔幻场景)",
+  "scene": "magic_ruins",
+  "description": "魔幻场景的塔防挑战,引入远程攻击敌人和隐身机制",
+  "backgroundImage": "images/LevelBackground/BG3",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草"
+  ],
+  "coinReward": 800,
+  "diamondReward": 50,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.4,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 5,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 5,
+          "spawnInterval": 6.0,
+          "spawnDelay": 10.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 45,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 30,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "wandering_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 5.0,
+          "characteristics": "左右摇摆, 近战范围大"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "wandering_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "左右摇摆, 近战范围大"
+        },
+        {
+          "enemyType": "boss1_gatekeeper",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 10.0,
+          "characteristics": "超高生命, 多种攻击方式, 召唤小怪"
+        }
+      ]
+    },
+    {
+      "waveId": 6,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "stealth_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 10.0,
+          "characteristics": "隐身能力, 快速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 7,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 80,
+          "spawnInterval": 0.7,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "stealth_zombie",
+          "count": 40,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "隐身能力, 快速移动"
+        },
+        {
+          "enemyType": "boss2_gravedigger",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 20.0,
+          "characteristics": "超高生命, 范围攻击, 召唤增援"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 6,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level3_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "105ac26d-15fa-416e-b230-363a3aca6a64",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 476 - 0
assets/data/backups/levels/Level4_20250919_113116.json

@@ -0,0 +1,476 @@
+{
+  "levelId": "Level4",
+  "name": "钢铁堡垒(工业场景)",
+  "scene": "industrial",
+  "description": "工业场景的高难度挑战,引入BOSS战和超高防御敌人",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹"
+  ],
+  "coinReward": 1000,
+  "diamondReward": 80,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.6,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 5,
+          "spawnInterval": 4.0,
+          "spawnDelay": 20.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "normal_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 5,
+          "spawnInterval": 4.0,
+          "spawnDelay": 20.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 5,
+          "spawnInterval": 8.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 5,
+          "spawnInterval": 8.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 10,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 10,
+          "spawnInterval": 6.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 20.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 1.0,
+          "spawnDelay": 30.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 20.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 20.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 30,
+          "spawnInterval": 1.0,
+          "spawnDelay": 30.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 20,
+          "spawnInterval": 2.0,
+          "spawnDelay": 20.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 6,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 20,
+          "spawnInterval": 2.5,
+          "spawnDelay": 10.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 6,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 20,
+          "spawnInterval": 2.5,
+          "spawnDelay": 10.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 7,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "boss1_gatekeeper",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 多种攻击方式, 召唤小怪"
+        }
+      ]
+    },
+    {
+      "waveId": 7,
+      "enemies": [
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 30,
+          "spawnInterval": 2.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "boss1_gatekeeper",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 多种攻击方式, 召唤小怪"
+        }
+      ]
+    },
+    {
+      "waveId": 8,
+      "enemies": [
+        {
+          "enemyType": "bucket_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "boss2_gravedigger",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 范围攻击, 召唤增援"
+        }
+      ]
+    },
+    {
+      "waveId": 8,
+      "enemies": [
+        {
+          "enemyType": "bucket_zombie",
+          "count": 60,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "boss2_gravedigger",
+          "count": 1,
+          "spawnInterval": 60.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 范围攻击, 召唤增援"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 6,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level4_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "9ac2d0a7-71ef-4088-ae59-b804d408645c",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 118 - 0
assets/data/backups/levels/Level5_20250919_113116.json

@@ -0,0 +1,118 @@
+{
+  "levelId": "Level5",
+  "name": "终极挑战(赛博都市)",
+  "scene": "cyberpunk",
+  "description": "终极挑战关卡,包含多个BOSS和复杂的敌人组合",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹",
+    "回旋镖盆栽"
+  ],
+  "coinReward": 1300,
+  "diamondReward": 100,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 1.8,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 8,
+          "spawnInterval": 3.0,
+          "spawnDelay": 10.0,
+          "characteristics": "高生命, 慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "mage_zombie",
+          "count": 8,
+          "spawnInterval": 4.0,
+          "spawnDelay": 0.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 6,
+          "spawnInterval": 6.0,
+          "spawnDelay": 15.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 15,
+          "spawnInterval": 1.2,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 2.5,
+          "spawnDelay": 8.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 8,
+          "spawnInterval": 3.5,
+          "spawnDelay": 20.0,
+          "characteristics": "远程魔法攻击, 中等生命"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 6,
+          "spawnInterval": 5.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 7,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level5_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "fd8c2868-72d5-416c-831b-0b83bf9d2ef7",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 119 - 0
assets/data/backups/levels/Level6_20250919_113116.json

@@ -0,0 +1,119 @@
+{
+  "levelId": "Level6",
+  "name": "沙漠绿洲(沙漠场景)",
+  "scene": "desert",
+  "description": "沙漠场景的挑战,炎热环境下的生存战斗",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹",
+    "回旋镖盆栽",
+    "炙热辣椒"
+  ],
+  "coinReward": 1800,
+  "diamondReward": 120,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 2.0,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 18,
+          "spawnInterval": 1.8,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 4,
+          "spawnInterval": 6.0,
+          "spawnDelay": 12.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 15,
+          "spawnInterval": 1.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 5,
+          "spawnInterval": 5.0,
+          "spawnDelay": 8.0,
+          "characteristics": "远程魔法子弹攻击防御塔"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 3,
+          "spawnInterval": 8.0,
+          "spawnDelay": 15.0,
+          "characteristics": "远程弓箭攻击"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 1.2,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "stealth_zombie",
+          "count": 4,
+          "spawnInterval": 10.0,
+          "spawnDelay": 20.0,
+          "characteristics": "隐身能力, 快速移动"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 6,
+          "spawnInterval": 4.0,
+          "spawnDelay": 25.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 7,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level6_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "91c547c0-dbcb-460e-b2b7-45c1df642fc3",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 57 - 0
assets/data/backups/levels/Level7_20250919_113116.json

@@ -0,0 +1,57 @@
+{
+  "levelId": "Level7",
+  "name": "冰雪王国(冰雪场景)",
+  "scene": "ice",
+  "description": "冰雪场景的极地挑战,寒冷环境下的防御战",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹",
+    "回旋镖盆栽",
+    "炙热辣椒",
+    "仙人散弹"
+  ],
+  "coinReward": 2200,
+  "diamondReward": 150,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 2.2,
+  "waves": [
+    {
+      "waveId": 3,
+      "enemies": []
+    },
+    {
+      "waveId": 4,
+      "enemies": []
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 8,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level7_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "f7e7fc38-66a5-49d1-9846-7d1ade408ea5",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 154 - 0
assets/data/backups/levels/Level8_20250919_113116.json

@@ -0,0 +1,154 @@
+{
+  "levelId": "Level8",
+  "name": "火山熔岩(火山场景)",
+  "scene": "volcano",
+  "description": "火山场景的极限挑战,熔岩环境下的终极考验",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹",
+    "回旋镖盆栽",
+    "炙热辣椒",
+    "仙人散弹",
+    "秋葵导弹"
+  ],
+  "coinReward": 2500,
+  "diamondReward": 170,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 2.4,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 30,
+          "spawnInterval": 1.2,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 10,
+          "spawnInterval": 3.0,
+          "spawnDelay": 8.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "wandering_zombie",
+          "count": 6,
+          "spawnInterval": 5.0,
+          "spawnDelay": 15.0,
+          "characteristics": "左右摇摆, 近战范围大"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 25,
+          "spawnInterval": 1.0,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 8,
+          "spawnInterval": 4.0,
+          "spawnDelay": 10.0,
+          "characteristics": "远程魔法子弹攻击防御塔"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 6,
+          "spawnInterval": 6.0,
+          "spawnDelay": 18.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "barrel_zombie",
+          "count": 4,
+          "spawnInterval": 10.0,
+          "spawnDelay": 25.0,
+          "characteristics": "爆炸伤害, 自爆攻击"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 20,
+          "spawnInterval": 0.8,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 12,
+          "spawnInterval": 2.5,
+          "spawnDelay": 12.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "stealth_zombie",
+          "count": 8,
+          "spawnInterval": 6.0,
+          "spawnDelay": 20.0,
+          "characteristics": "隐身能力, 快速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "boss2_gravedigger",
+          "count": 1,
+          "spawnInterval": 0.0,
+          "spawnDelay": 30.0,
+          "characteristics": "超高生命, 范围攻击, 召唤增援"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 6,
+          "spawnInterval": 8.0,
+          "spawnDelay": 45.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 8,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level8_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "e48d4715-dc3b-4b58-88d9-64660482984d",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 174 - 0
assets/data/backups/levels/Level9_20250919_113116.json

@@ -0,0 +1,174 @@
+{
+  "levelId": "Level9",
+  "name": "终极试炼(终极场景)",
+  "scene": "ultimate",
+  "description": "终极试炼关卡,解锁最后的植物武器,面对最强挑战",
+  "backgroundImage": "images/LevelBackground/BG1",
+  "availableWeapons": [
+    "毛豆射手",
+    "尖胡萝卜",
+    "锯齿草",
+    "西瓜炸弹",
+    "回旋镖盆栽",
+    "炙热辣椒",
+    "仙人散弹",
+    "秋葵导弹",
+    "狼牙棒"
+  ],
+  "coinReward": 3000,
+  "diamondReward": 200,
+  "initialCoins": 100,
+  "timeLimit": 300,
+  "difficulty": "normal",
+  "healthMultiplier": 2.6,
+  "waves": [
+    {
+      "waveId": 1,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 40,
+          "spawnInterval": 0.8,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "roadblock_zombie",
+          "count": 15,
+          "spawnInterval": 2.5,
+          "spawnDelay": 5.0,
+          "characteristics": "高生命, 慢速移动"
+        },
+        {
+          "enemyType": "wandering_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 12.0,
+          "characteristics": "左右摇摆, 近战范围大"
+        }
+      ]
+    },
+    {
+      "waveId": 2,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 35,
+          "spawnInterval": 0.6,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "mage_zombie",
+          "count": 12,
+          "spawnInterval": 3.0,
+          "spawnDelay": 8.0,
+          "characteristics": "远程魔法子弹攻击防御塔"
+        },
+        {
+          "enemyType": "archer_zombie",
+          "count": 10,
+          "spawnInterval": 4.0,
+          "spawnDelay": 15.0,
+          "characteristics": "远程弓箭攻击"
+        },
+        {
+          "enemyType": "barrel_zombie",
+          "count": 6,
+          "spawnInterval": 8.0,
+          "spawnDelay": 22.0,
+          "characteristics": "爆炸伤害, 自爆攻击"
+        }
+      ]
+    },
+    {
+      "waveId": 3,
+      "enemies": [
+        {
+          "enemyType": "normal_zombie",
+          "count": 30,
+          "spawnInterval": 0.5,
+          "spawnDelay": 0.0,
+          "characteristics": "中速移动, 无技能"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 15,
+          "spawnInterval": 2.0,
+          "spawnDelay": 10.0,
+          "characteristics": "超高生命, 极慢速移动"
+        },
+        {
+          "enemyType": "stealth_zombie",
+          "count": 12,
+          "spawnInterval": 4.0,
+          "spawnDelay": 18.0,
+          "characteristics": "隐身能力, 快速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 4,
+      "enemies": [
+        {
+          "enemyType": "boss1_gatekeeper",
+          "count": 1,
+          "spawnInterval": 0.0,
+          "spawnDelay": 25.0,
+          "characteristics": "超高生命, 多种攻击方式, 召唤小怪"
+        },
+        {
+          "enemyType": "boss2_gravedigger",
+          "count": 1,
+          "spawnInterval": 0.0,
+          "spawnDelay": 60.0,
+          "characteristics": "超高生命, 范围攻击, 召唤增援"
+        },
+        {
+          "enemyType": "bucket_zombie",
+          "count": 10,
+          "spawnInterval": 6.0,
+          "spawnDelay": 40.0,
+          "characteristics": "超高生命, 极慢速移动"
+        }
+      ]
+    },
+    {
+      "waveId": 5,
+      "enemies": [
+        {
+          "enemyType": "终极BOSS",
+          "count": 1,
+          "spawnInterval": 0.0,
+          "spawnDelay": 30.0,
+          "characteristics": "极高生命, 全屏攻击, 无敌阶段, 召唤军团"
+        }
+      ]
+    }
+  ],
+  "levelSettings": {
+    "energyMax": 9,
+    "energyMaxUpgrades": [
+      5,
+      10,
+      15,
+      20,
+      25,
+      30,
+      40,
+      50,
+      60,
+      70,
+      80,
+      90,
+      100,
+      120,
+      150,
+      200,
+      300,
+      400,
+      500,
+      500
+    ]
+  }
+}

+ 11 - 0
assets/data/backups/levels/Level9_20250919_113116.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "7f2d1648-5d44-4e2f-aa2f-1641ec053c42",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 24 - 17
assets/scripts/AudioManager/AudioManager.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, AudioClip, AudioSource, resources, Node } from 'cc';
+import { BundleLoader } from '../Core/BundleLoader';
 const { ccclass, property } = _decorator;
 
 /**
@@ -36,6 +37,9 @@ export class AudioManager extends Component {
     // 当前播放的音乐
     private currentMusicClip: AudioClip = null;
     
+    // Bundle加载器
+    private bundleLoader: BundleLoader = null;
+    
     // 单例实例
     private static _instance: AudioManager = null;
     
@@ -51,6 +55,7 @@ export class AudioManager extends Component {
             return;
         }
         
+        this.bundleLoader = BundleLoader.getInstance();
         this.initializeAudioSources();
     }
     
@@ -112,17 +117,16 @@ export class AudioManager extends Component {
      * @param musicPath 音乐资源路径
      * @param loop 是否循环播放
      */
-    public playMusic(musicPath: string, loop: boolean = true) {
+    public async playMusic(musicPath: string, loop: boolean = true) {
         if (!this.musicAudioSource) {
             console.warn('[AudioManager] 音乐播放器未初始化');
             return;
         }
         
-        resources.load(musicPath, AudioClip, (err, clip) => {
-            if (err) {
-                console.error(`[AudioManager] 加载音乐失败: ${musicPath}`, err);
-                return;
-            }
+        try {
+            // 转换路径格式:从 "data/弹球音效/fight bgm" 转换为 "弹球音效/fight bgm"
+            const bundlePath = musicPath.replace('data/', '');
+            const clip = await this.bundleLoader.loadAssetFromBundle<AudioClip>('data', bundlePath, AudioClip);
             
             this.currentMusicClip = clip;
             this.musicAudioSource.clip = clip;
@@ -130,7 +134,9 @@ export class AudioManager extends Component {
             this.musicAudioSource.play();
             
             console.log(`[AudioManager] 播放音乐: ${musicPath}`);
-        });
+        } catch (error) {
+            console.error(`[AudioManager] 加载音乐失败: ${musicPath}`, error);
+        }
     }
     
     /**
@@ -216,20 +222,19 @@ export class AudioManager extends Component {
      * @param baseVolume 基础音量
      * @param soundType 音效类型(用于日志)
      */
-    private playSound(audioSource: AudioSource, sfxPath: string, volume: number | undefined, baseVolume: number, soundType: string) {
+    private async playSound(audioSource: AudioSource, sfxPath: string, volume: number | undefined, baseVolume: number, soundType: string) {
         if (!audioSource) {
             console.warn(`[AudioManager] ${soundType}播放器未初始化`);
             return;
         }
         
-        // 去掉.mp3后缀(如果存在)
-        const cleanPath = sfxPath.endsWith('.mp3') ? sfxPath.slice(0, -4) : sfxPath;
-        
-        resources.load(cleanPath, AudioClip, (err, clip) => {
-            if (err) {
-                console.error(`[AudioManager] 加载${soundType}失败: ${cleanPath}`, err);
-                return;
-            }
+        try {
+            // 去掉.mp3后缀(如果存在)
+            const cleanPath = sfxPath.endsWith('.mp3') ? sfxPath.slice(0, -4) : sfxPath;
+            
+            // 转换路径格式:从 "data/弹球音效/xxx" 转换为 "弹球音效/xxx"
+            const bundlePath = cleanPath.replace('data/', '');
+            const clip = await this.bundleLoader.loadAssetFromBundle<AudioClip>('data', bundlePath, AudioClip);
             
             // 设置临时音量(如果指定)
             const originalVolume = audioSource.volume;
@@ -245,7 +250,9 @@ export class AudioManager extends Component {
             }
             
             console.log(`[AudioManager] 播放${soundType}: ${cleanPath}`);
-        });
+        } catch (error) {
+            console.error(`[AudioManager] 加载${soundType}失败: ${sfxPath}`, error);
+        }
     }
     
     /**

+ 31 - 11
assets/scripts/CombatSystem/BlockManager.ts

@@ -9,6 +9,7 @@ import { BlockInfo } from './BlockSelection/BlockInfo';
 import { SkillManager } from './SkillSelection/SkillManager';
 import EventBus, { GameEvents } from '../Core/EventBus';
 import { sp } from 'cc';
+import { BundleLoader } from '../Core/BundleLoader';
 const { ccclass, property } = _decorator;
 
 @ccclass('BlockManager')
@@ -155,6 +156,8 @@ export class BlockManager extends Component {
     // 配置是否已预加载的标志
     private isWeaponsConfigPreloaded: boolean = false;
     
+    private bundleLoader: BundleLoader = null;
+    
 
     
     // 调试绘制相关
@@ -298,6 +301,9 @@ export class BlockManager extends Component {
         } else {
             console.log('[BlockManager] LevelConfigManager实例获取成功');
         }
+        
+        // 获取BundleLoader实例
+        this.bundleLoader = BundleLoader.getInstance();
 
         // 如果没有指定GridContainer,尝试找到它
         if (!this.gridContainer) {
@@ -1860,21 +1866,33 @@ export class BlockManager extends Component {
         }
         
         // 获取武器配置中的图片路径
-        const spritePath = weaponConfig.visualConfig?.weaponSprites;
-        if (!spritePath) {
+        const weaponSprites = weaponConfig.visualConfig?.weaponSprites;
+        if (!weaponSprites) {
             console.warn(`武器 ${weaponConfig.name} 没有配置图片信息`);
             return;
         }
         
-        // 正确的SpriteFrame子资源路径
-        const spriteFramePath = `${spritePath}/spriteFrame`;
+        // 获取第一个可用的精灵路径(通常是'I'形状)
+         let spritePath: string;
+         if (typeof weaponSprites === 'string') {
+             spritePath = weaponSprites;
+         } else {
+             // 优先使用'I'形状,如果没有则使用第一个可用的
+             const keys = Object.keys(weaponSprites);
+             spritePath = weaponSprites['I'] || (keys.length > 0 ? weaponSprites[keys[0]] : null);
+         }
         
-        // 加载SpriteFrame子资源
-        resources.load(spriteFramePath, SpriteFrame, (err, spriteFrame) => {
-            if (err) {
-                console.warn(`加载武器图片失败: ${spriteFramePath}`, err);
-                return;
-            }
+        if (!spritePath) {
+            console.warn(`武器 ${weaponConfig.name} 没有可用的精灵路径`);
+            return;
+        }
+        
+        // 转换路径格式,去除"images/"前缀
+        const bundlePath = spritePath.replace(/^images\//, '');
+        
+        try {
+            // 使用BundleLoader从images Bundle加载SpriteFrame,添加/spriteFrame后缀
+            const spriteFrame = await this.bundleLoader.loadSpriteFrame(`${bundlePath}/spriteFrame`);
             
             // Add comprehensive null safety checks before setting spriteFrame
             if (weaponSprite && weaponSprite.isValid && 
@@ -1891,7 +1909,9 @@ export class BlockManager extends Component {
                 const blockShape = this.getBlockShape(block);
                 this.rotateWeaponIconByShape(weaponNode, blockShape, weaponConfig.id);
             }
-        });
+        } catch (err) {
+            console.warn(`加载武器图片失败: ${bundlePath}`, err);
+        }
     }
     
     // 武器类型和方块形状组合的旋转角度配置

+ 14 - 12
assets/scripts/CombatSystem/EnemyInstance.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, Node, ProgressBar, Label, Vec3, find, UITransform, Collider2D, Contact2DType, IPhysics2DContact, instantiate, resources, Prefab, JsonAsset, RigidBody2D, ERigidBody2DType, BoxCollider2D, CircleCollider2D } from 'cc';
+import { BundleLoader } from '../Core/BundleLoader';
 import { sp } from 'cc';
 import { DamageNumberAni } from '../Animations/DamageNumberAni';
 import { HPBarAnimation } from '../Animations/HPBarAnimation';
@@ -99,18 +100,19 @@ export class EnemyInstance extends Component {
     public static async loadEnemyDatabase(): Promise<void> {
         if (EnemyInstance.enemyDatabase) return;
         
-        return new Promise((resolve, reject) => {
-            resources.load('data/enemies', JsonAsset, (err, jsonAsset) => {
-                if (err) {
-                    console.error('[EnemyInstance] 加载敌人配置失败:', err);
-                    reject(err);
-                    return;
-                }
-                
-                EnemyInstance.enemyDatabase = jsonAsset.json;
-                resolve();
-            });
-        });
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const enemyData = await bundleLoader.loadDataJson('enemies');
+            
+            if (!enemyData) {
+                throw new Error('敌人配置文件内容为空');
+            }
+            
+            EnemyInstance.enemyDatabase = enemyData;
+        } catch (error) {
+            console.error('[EnemyInstance] 加载敌人配置失败:', error);
+            throw error;
+        }
     }
     
     // 设置敌人配置

+ 12 - 6
assets/scripts/CombatSystem/SkillSelection/SkillSelectionController.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, Node, find, CCFloat, resources, JsonAsset } from 'cc';
+import { BundleLoader } from '../../Core/BundleLoader';
 import { GameManager } from '../../LevelSystem/GameManager';
 import { InGameManager } from '../../LevelSystem/IN_game';
 import { SkillButtonController } from './SkillButtonController';
@@ -44,14 +45,17 @@ export class SkillSelectionController extends Component {
     /**
      * 加载技能配置
      */
-    private loadSkillConfig() {
-        resources.load('data/skill', JsonAsset, (err, jsonAsset: JsonAsset) => {
-            if (err) {
-                console.error('加载技能配置失败:', err);
+    private async loadSkillConfig() {
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const skillData = await bundleLoader.loadDataJson('skill');
+            
+            if (!skillData) {
+                console.error('技能配置文件内容为空');
                 return;
             }
             
-            this._skillConfig = jsonAsset.json as SkillConfig;
+            this._skillConfig = skillData.json as SkillConfig;
             
             // 初始化技能管理器
             const skillManager = SkillManager.getInstance();
@@ -61,7 +65,9 @@ export class SkillSelectionController extends Component {
             
             this.setupSkillButtons();
             this.randomizeSkills();
-        });
+        } catch (error) {
+            console.error('加载技能配置失败:', error);
+        }
     }
 
     private setupSkillButtons() {

+ 17 - 15
assets/scripts/CombatSystem/WeaponBullet.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, Node, Vec2, Vec3, RigidBody2D, Collider2D, Contact2DType, IPhysics2DContact, find, Prefab, instantiate, UITransform, resources, sp, JsonAsset, Sprite, SpriteFrame, math } from 'cc';
+import { BundleLoader } from '../Core/BundleLoader';
 import { BulletCount, BulletSpawnInfo } from './BulletEffects/BulletCount';
 import { BulletTrajectory } from './BulletEffects/BulletTrajectory';
 import { BulletHitEffect, HitResult } from './BulletEffects/BulletHitEffect';
@@ -67,23 +68,24 @@ export class WeaponBullet extends Component {
     /**
      * 加载武器配置数据
      */
-    public static loadWeaponsData(): Promise<void> {
-        return new Promise((resolve, reject) => {
-            if (WeaponBullet.weaponsData) {
-                resolve();
-                return;
+    public static async loadWeaponsData(): Promise<void> {
+        if (WeaponBullet.weaponsData) {
+            return;
+        }
+        
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const weaponData = await bundleLoader.loadDataJson('weapons');
+            
+            if (!weaponData) {
+                throw new Error('武器配置文件内容为空');
             }
             
-            resources.load('data/weapons', JsonAsset, (err, jsonAsset: JsonAsset) => {
-                if (err) {
-                    reject(err);
-                    return;
-                }
-                
-                WeaponBullet.weaponsData = jsonAsset.json;
-                resolve();
-            });
-        });
+            WeaponBullet.weaponsData = weaponData;
+        } catch (error) {
+            console.error('[WeaponBullet] 武器配置文件加载失败:', error);
+            throw error;
+        }
     }
     
     /**

+ 177 - 0
assets/scripts/Core/BundleLoader.ts

@@ -0,0 +1,177 @@
+import { assetManager, JsonAsset, Asset, SpriteFrame } from 'cc';
+
+/**
+ * Bundle资源加载器
+ * 统一管理Asset Bundle的加载和资源获取
+ */
+export class BundleLoader {
+    private static instance: BundleLoader = null;
+    private loadedBundles: Map<string, any> = new Map();
+    private loadingPromises: Map<string, Promise<any>> = new Map();
+
+    public static getInstance(): BundleLoader {
+        if (!BundleLoader.instance) {
+            BundleLoader.instance = new BundleLoader();
+        }
+        return BundleLoader.instance;
+    }
+
+    /**
+     * 加载Bundle
+     * @param bundleName Bundle名称
+     * @returns Promise<Bundle>
+     */
+    public async loadBundle(bundleName: string): Promise<any> {
+        // 如果已经加载过,直接返回
+        if (this.loadedBundles.has(bundleName)) {
+            return this.loadedBundles.get(bundleName);
+        }
+
+        // 如果正在加载,返回加载Promise
+        if (this.loadingPromises.has(bundleName)) {
+            return this.loadingPromises.get(bundleName);
+        }
+
+        // 开始加载Bundle
+        const loadingPromise = new Promise<any>((resolve, reject) => {
+            console.log(`[BundleLoader] 开始加载Bundle: ${bundleName}`);
+            assetManager.loadBundle(bundleName, (err, bundle) => {
+                if (err) {
+                    console.error(`[BundleLoader] 加载Bundle失败: ${bundleName}`, err);
+                    this.loadingPromises.delete(bundleName);
+                    reject(err);
+                    return;
+                }
+                
+                console.log(`[BundleLoader] Bundle加载成功: ${bundleName}`);
+                this.loadedBundles.set(bundleName, bundle);
+                this.loadingPromises.delete(bundleName);
+                resolve(bundle);
+            });
+        });
+
+        this.loadingPromises.set(bundleName, loadingPromise);
+        return loadingPromise;
+    }
+
+    /**
+     * 从Bundle中加载资源
+     * @param bundleName Bundle名称
+     * @param resourcePath 资源路径(相对于Bundle根目录)
+     * @param assetType 资源类型
+     * @returns Promise<Asset>
+     */
+    public async loadAssetFromBundle<T extends Asset>(bundleName: string, resourcePath: string, assetType?: typeof Asset): Promise<T> {
+        try {
+            // 先确保Bundle已加载
+            const bundle = await this.loadBundle(bundleName);
+            
+            return new Promise<T>((resolve, reject) => {
+                console.log(`[BundleLoader] 从Bundle ${bundleName} 加载资源: ${resourcePath}`);
+                
+                if (assetType) {
+                    bundle.load(resourcePath, assetType, (err: Error, asset: T) => {
+                        if (err) {
+                            console.error(`[BundleLoader] 从Bundle ${bundleName} 加载资源失败: ${resourcePath}`, err);
+                            reject(err);
+                            return;
+                        }
+                        console.log(`[BundleLoader] 资源加载成功: ${bundleName}/${resourcePath}`);
+                        resolve(asset);
+                    });
+                } else {
+                    bundle.load(resourcePath, (err: Error, asset: T) => {
+                        if (err) {
+                            console.error(`[BundleLoader] 从Bundle ${bundleName} 加载资源失败: ${resourcePath}`, err);
+                            reject(err);
+                            return;
+                        }
+                        console.log(`[BundleLoader] 资源加载成功: ${bundleName}/${resourcePath}`);
+                        resolve(asset);
+                    });
+                }
+            });
+        } catch (error) {
+            console.error(`[BundleLoader] 加载资源时发生错误: ${bundleName}/${resourcePath}`, error);
+            throw error;
+        }
+    }
+
+    /**
+     * 从data Bundle加载JSON资源的便捷方法
+     * @param resourcePath 资源路径(相对于data Bundle根目录)
+     * @returns Promise<JsonAsset>
+     */
+    public async loadDataJson(resourcePath: string): Promise<JsonAsset> {
+        return this.loadAssetFromBundle<JsonAsset>('data', resourcePath, JsonAsset);
+    }
+
+    /**
+     * 从images Bundle加载图片资源的便捷方法
+     * @param resourcePath 资源路径(相对于images Bundle根目录)
+     * @returns Promise<Asset>
+     */
+    public async loadImage(resourcePath: string): Promise<Asset> {
+        return this.loadAssetFromBundle('images', resourcePath);
+    }
+
+    /**
+     * 从images Bundle加载SpriteFrame资源的便捷方法
+     * @param resourcePath 资源路径(相对于images Bundle根目录)
+     * @returns Promise<SpriteFrame>
+     */
+    public async loadSpriteFrame(resourcePath: string): Promise<SpriteFrame> {
+        return this.loadAssetFromBundle<SpriteFrame>('images', resourcePath, SpriteFrame);
+    }
+
+    /**
+     * 从Animation Bundle加载动画资源的便捷方法
+     * @param resourcePath 资源路径(相对于Animation Bundle根目录)
+     * @returns Promise<Asset>
+     */
+    public async loadAnimation(resourcePath: string): Promise<Asset> {
+        return this.loadAssetFromBundle('Animation', resourcePath);
+    }
+
+    /**
+     * 检查Bundle是否已加载
+     * @param bundleName Bundle名称
+     * @returns boolean
+     */
+    public isBundleLoaded(bundleName: string): boolean {
+        return this.loadedBundles.has(bundleName);
+    }
+
+    /**
+     * 获取已加载的Bundle
+     * @param bundleName Bundle名称
+     * @returns Bundle | null
+     */
+    public getLoadedBundle(bundleName: string): any {
+        return this.loadedBundles.get(bundleName) || null;
+    }
+
+    /**
+     * 释放Bundle资源
+     * @param bundleName Bundle名称
+     */
+    public releaseBundle(bundleName: string): void {
+        const bundle = this.loadedBundles.get(bundleName);
+        if (bundle) {
+            bundle.releaseAll();
+            this.loadedBundles.delete(bundleName);
+            console.log(`[BundleLoader] Bundle已释放: ${bundleName}`);
+        }
+    }
+
+    /**
+     * 释放所有Bundle资源
+     */
+    public releaseAllBundles(): void {
+        for (const [bundleName, bundle] of this.loadedBundles) {
+            bundle.releaseAll();
+        }
+        this.loadedBundles.clear();
+        console.log('[BundleLoader] 所有Bundle已释放');
+    }
+}

+ 9 - 0
assets/scripts/Core/BundleLoader.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "e79c590c-f137-468c-8ac3-dbd0a3233261",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 54 - 64
assets/scripts/Core/ConfigManager.ts

@@ -1,5 +1,6 @@
 import { _decorator, resources, JsonAsset } from 'cc';
 import { BaseSingleton } from './BaseSingleton';
+import { BundleLoader } from './BundleLoader';
 const { ccclass, property } = _decorator;
 
 // 局内金币花费配置接口
@@ -294,73 +295,62 @@ export class ConfigManager extends BaseSingleton {
     }
 
     // 加载武器配置
-    private loadWeaponsConfig(): Promise<void> {
-        return new Promise((resolve, reject) => {
-            console.log('[ConfigManager] 开始加载武器配置...');
-            resources.load('data/weapons', JsonAsset, (err, asset) => {
-                if (err) {
-                    console.error('[ConfigManager] 武器配置文件加载失败:', err);
-                    reject(err);
-                    return;
-                }
-                
-                if (!asset || !asset.json) {
-                    console.error('[ConfigManager] 武器配置文件内容为空');
-                    reject(new Error('武器配置文件内容为空'));
-                    return;
-                }
-                
-                this.weaponsConfig = asset.json as any;
-                
-                // 验证配置完整性
-                console.log('[ConfigManager] 验证武器配置完整性...');
-                if (!this.weaponsConfig.weapons || !Array.isArray(this.weaponsConfig.weapons)) {
-                    console.error('[ConfigManager] 武器配置格式错误:缺少weapons数组');
-                    reject(new Error('武器配置格式错误'));
-                    return;
-                }
-                
-                console.log(`[ConfigManager] 武器配置加载成功,共${this.weaponsConfig.weapons.length}个武器`);
-                
-                // 检查blockSizes配置
-                if (this.weaponsConfig.blockSizes && Array.isArray(this.weaponsConfig.blockSizes)) {
-                    console.log(`[ConfigManager] ✅ blockSizes配置加载成功,共${this.weaponsConfig.blockSizes.length}个形状`);
-                    this.weaponsConfig.blockSizes.forEach(shape => {
-                        console.log(`[ConfigManager] - 形状: ${shape.id} (${shape.name})`);
-                    });
-                } else {
-                    console.warn('[ConfigManager] ⚠️ blockSizes配置缺失或格式错误');
-                }
-                
-
-                resolve();
-            });
-        });
+    private async loadWeaponsConfig(): Promise<void> {
+        console.log('[ConfigManager] 开始加载武器配置...');
+        
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const weaponData = await bundleLoader.loadDataJson('weapons');
+            
+            if (!weaponData) {
+                throw new Error('武器配置文件内容为空');
+            }
+            
+            // JsonAsset对象,需要访问.json属性获取实际数据
+            this.weaponsConfig = weaponData.json;
+            
+            // 验证配置完整性
+            console.log('[ConfigManager] 验证武器配置完整性...');
+            if (!this.weaponsConfig.weapons || !Array.isArray(this.weaponsConfig.weapons)) {
+                throw new Error('武器配置格式错误:缺少weapons数组');
+            }
+            
+            console.log(`[ConfigManager] 武器配置加载成功,共${this.weaponsConfig.weapons.length}个武器`);
+            
+            // 检查blockSizes配置
+            if (this.weaponsConfig.blockSizes && Array.isArray(this.weaponsConfig.blockSizes)) {
+                console.log(`[ConfigManager] ✅ blockSizes配置加载成功,共${this.weaponsConfig.blockSizes.length}个形状`);
+                this.weaponsConfig.blockSizes.forEach(shape => {
+                    console.log(`[ConfigManager] - 形状: ${shape.id} (${shape.name})`);
+                });
+            } else {
+                console.warn('[ConfigManager] ⚠️ blockSizes配置缺失或格式错误');
+            }
+        } catch (error) {
+            console.error('[ConfigManager] 武器配置文件加载失败:', error);
+            throw error;
+        }
     }
 
     // 加载敌人配置
-    private loadEnemiesConfig(): Promise<void> {
-        return new Promise((resolve, reject) => {
-            console.log('加载敌人配置...');
-            resources.load('data/enemies', JsonAsset, (err, asset) => {
-                if (err) {
-                    console.error('敌人配置文件加载失败:', err);
-                    reject(err);
-                    return;
-                }
-                
-                if (!asset || !asset.json) {
-                    console.error('敌人配置文件内容为空');
-                    reject(new Error('敌人配置文件内容为空'));
-                    return;
-                }
-
-                this.enemiesConfig = asset.json as any;
-                console.log('✅ 敌人配置加载成功');
-
-                resolve();
-            });
-        });
+    private async loadEnemiesConfig(): Promise<void> {
+        console.log('[ConfigManager] 开始加载敌人配置...');
+        
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const enemyData = await bundleLoader.loadDataJson('enemies');
+            
+            if (!enemyData) {
+                throw new Error('敌人配置文件内容为空');
+            }
+            
+            // JsonAsset对象,需要访问.json属性获取实际数据
+            this.enemiesConfig = enemyData.json;
+            console.log('[ConfigManager] ✅ 敌人配置加载成功');
+        } catch (error) {
+            console.error('[ConfigManager] 敌人配置文件加载失败:', error);
+            throw error;
+        }
     }
 
     // 随机获取武器配置

+ 16 - 22
assets/scripts/Core/LevelSessionManager.ts

@@ -1,4 +1,5 @@
-import { resources, JsonAsset } from 'cc';
+import { JsonAsset } from 'cc';
+import { BundleLoader } from './BundleLoader';
 
 export interface LevelRuntimeData {
   levelId: number;               // 本局关卡
@@ -39,29 +40,22 @@ export class LevelSessionManager {
   /** 从关卡配置文件加载初始金币数量 */
   private async loadInitialCoins(levelId: number): Promise<number> {
     try {
-      const jsonPath = `data/levels/Level${levelId}`;
-      console.log(`[LevelSessionManager] 尝试加载关卡配置: ${jsonPath}`);
+      const resourcePath = `levels/Level${levelId}`;
+      console.log(`[LevelSessionManager] 尝试从data Bundle加载关卡配置: ${resourcePath}`);
       
-      return new Promise<number>((resolve) => {
-        resources.load(jsonPath, JsonAsset, (err, asset) => {
-          if (err) {
-            console.warn(`[LevelSessionManager] 加载关卡${levelId}配置失败,使用默认初始金币45:`, err);
-            resolve(45); // 默认值
-            return;
-          }
-          
-          const levelConfig = asset.json;
-          if (levelConfig && typeof levelConfig.initialCoins === 'number') {
-            console.log(`[LevelSessionManager] 关卡${levelId}初始金币配置: ${levelConfig.initialCoins}`);
-            resolve(levelConfig.initialCoins);
-          } else {
-            console.warn(`[LevelSessionManager] 关卡${levelId}配置中未找到initialCoins字段,使用默认值45`);
-            resolve(45); // 默认值
-          }
-        });
-      });
+      const bundleLoader = BundleLoader.getInstance();
+      const asset = await bundleLoader.loadDataJson(resourcePath);
+      
+      const levelConfig = asset.json;
+      if (levelConfig && typeof levelConfig.initialCoins === 'number') {
+        console.log(`[LevelSessionManager] 关卡${levelId}初始金币配置: ${levelConfig.initialCoins}`);
+        return levelConfig.initialCoins;
+      } else {
+        console.warn(`[LevelSessionManager] 关卡${levelId}配置中未找到initialCoins字段,使用默认值45`);
+        return 45; // 默认值
+      }
     } catch (error) {
-      console.error(`[LevelSessionManager] 加载关卡${levelId}初始金币配置时发生错误:`, error);
+      console.warn(`[LevelSessionManager] 加载关卡${levelId}配置失败,使用默认初始金币45:`, error);
       return 45; // 默认值
     }
   }

+ 15 - 13
assets/scripts/FourUI/SkillSystem/SkillConfigManager.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, resources, JsonAsset } from 'cc';
+import { BundleLoader } from '../../Core/BundleLoader';
 const { ccclass, property } = _decorator;
 
 /**
@@ -64,23 +65,24 @@ export class SkillConfigManager extends Component {
     /**
      * 加载技能配置
      */
-    private loadSkillConfig() {
-        resources.load('data/skill_config', JsonAsset, (err, jsonAsset) => {
-            if (err) {
-                console.error('加载技能配置失败:', err);
+    private async loadSkillConfig() {
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const skillConfigData = await bundleLoader.loadDataJson('skill_config');
+            
+            if (!skillConfigData) {
+                console.error('技能配置文件内容为空');
                 this.createDefaultConfig();
                 return;
             }
 
-            try {
-                this._skillConfig = jsonAsset.json as SkillConfig;
-                this._isLoaded = true;
-                console.log('技能配置加载成功:', this._skillConfig);
-            } catch (error) {
-                console.error('解析技能配置失败:', error);
-                this.createDefaultConfig();
-            }
-        });
+            this._skillConfig = skillConfigData.json as SkillConfig;
+            this._isLoaded = true;
+            console.log('技能配置加载成功:', this._skillConfig);
+        } catch (error) {
+            console.error('加载技能配置失败:', error);
+            this.createDefaultConfig();
+        }
     }
 
     /**

+ 15 - 13
assets/scripts/FourUI/UpgradeSystem/UpgradeAni.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, Node, Tween, tween, Vec3, Material, Sprite, resources, Label, JsonAsset } from 'cc';
+import { BundleLoader } from '../../Core/BundleLoader';
 import { Audio } from '../../AudioManager/AudioManager';
 
 const { ccclass, property } = _decorator;
@@ -252,19 +253,20 @@ export class UpgradeAni extends Component {
      * 加载武器配置数据
      */
     public async loadWeaponsConfig(): Promise<void> {
-        return new Promise((resolve, reject) => {
-            resources.load('data/weapons', JsonAsset, (err, weaponsData) => {
-                if (err) {
-                    console.error('[UpgradeAni] 加载武器配置失败:', err);
-                    reject(err);
-                    return;
-                }
-                
-                this.weaponsConfig = weaponsData.json || weaponsData;
-                console.log('[UpgradeAni] 武器配置加载成功');
-                resolve();
-            });
-        });
+        try {
+            const bundleLoader = BundleLoader.getInstance();
+            const weaponData = await bundleLoader.loadDataJson('weapons');
+            
+            if (!weaponData) {
+                throw new Error('武器配置文件内容为空');
+            }
+            
+            this.weaponsConfig = weaponData;
+            console.log('[UpgradeAni] 武器配置加载成功');
+        } catch (error) {
+            console.error('[UpgradeAni] 加载武器配置失败:', error);
+            throw error;
+        }
     }
     
     /**

+ 45 - 44
assets/scripts/FourUI/UpgradeSystem/UpgradeController.ts

@@ -1,4 +1,5 @@
 import { _decorator, Component, Node, Button, Label, Sprite, SpriteFrame, Texture2D, resources, ScrollView, Layout, Prefab, instantiate, find, UIOpacity, Color } from 'cc';
+import { BundleLoader } from '../../Core/BundleLoader';
 import { SaveDataManager, WeaponData } from '../../LevelSystem/SaveDataManager';
 import EventBus, { GameEvents } from '../../Core/EventBus';
 import { UpgradeAni } from './UpgradeAni';
@@ -74,12 +75,14 @@ export class UpgradeController extends Component {
     private weaponsConfig: { weapons: WeaponConfig[] } = null;
     private currentSelectedWeapon: string = null;
     private levelConfigs: any[] = [];
+    private bundleLoader: BundleLoader = null;
     
     // 武器节点列表
     private weaponNodes: Node[] = [];
     
     onLoad() {
         this.saveDataManager = SaveDataManager.getInstance();
+        this.bundleLoader = BundleLoader.getInstance();
         this.bindEvents();
     }
     
@@ -107,7 +110,7 @@ export class UpgradeController extends Component {
         this.checkInitialWeaponUnlocks();
         
         // 刷新UI
-        this.refreshWeaponList();
+        await this.refreshWeaponList();
         
         // 初始化升级面板状态
         if (this.upgradeAni) {
@@ -141,12 +144,8 @@ export class UpgradeController extends Component {
      */
     private async loadWeaponsConfig() {
         try {
-            const jsonAsset = await new Promise<any>((resolve, reject) => {
-                resources.load('data/weapons', (err, asset) => {
-                    if (err) reject(err);
-                    else resolve(asset);
-                });
-            });
+            const bundleLoader = BundleLoader.getInstance();
+            const jsonAsset = await bundleLoader.loadDataJson('weapons');
             
             this.weaponsConfig = jsonAsset.json;
             console.log('[UpgradeController] 武器配置加载成功:', this.weaponsConfig);
@@ -161,19 +160,16 @@ export class UpgradeController extends Component {
     private async loadLevelConfigs() {
         try {
             this.levelConfigs = [];
+            const bundleLoader = BundleLoader.getInstance();
+            
             // 加载Level1到Level5的配置
             for (let i = 1; i <= 5; i++) {
                 try {
-                    const levelData = await new Promise<any>((resolve, reject) => {
-                        resources.load(`data/levels/Level${i}`, (err, asset) => {
-                            if (err) reject(err);
-                            else resolve(asset);
-                        });
-                    });
+                    const levelData = await bundleLoader.loadDataJson(`levels/Level${i}`);
                     
                     this.levelConfigs.push({
                         level: i,
-                        ...levelData
+                        ...levelData.json
                     });
                 } catch (error) {
                     console.warn(`加载Level${i}配置失败:`, error);
@@ -243,7 +239,7 @@ export class UpgradeController extends Component {
     /**
      * 刷新武器列表UI
      */
-    private refreshWeaponList() {
+    private async refreshWeaponList() {
         if (!this.weaponsConfig || !this.weaponLayout) {
             console.warn('武器配置或武器布局未初始化');
             return;
@@ -253,15 +249,16 @@ export class UpgradeController extends Component {
         this.clearWeaponNodes();
         
         // 为每个武器创建UI节点
-        this.weaponsConfig.weapons.forEach((weaponConfig, index) => {
-            this.createWeaponNode(weaponConfig, index);
-        });
+        for (let index = 0; index < this.weaponsConfig.weapons.length; index++) {
+            const weaponConfig = this.weaponsConfig.weapons[index];
+            await this.createWeaponNode(weaponConfig, index);
+        }
     }
     
     /**
      * 切换武器节点状态(从锁定到解锁或反之)
      */
-    private switchWeaponNodeState(weaponId: string) {
+    private async switchWeaponNodeState(weaponId: string) {
         const weaponConfig = this.weaponsConfig.weapons.find(w => w.id === weaponId);
         if (!weaponConfig) {
             console.warn(`未找到武器配置: ${weaponId}`);
@@ -284,7 +281,7 @@ export class UpgradeController extends Component {
         if (isUnlocked) {
             if (this.unlockedWeaponPrefab) {
                 newNode = instantiate(this.unlockedWeaponPrefab);
-                this.setupUnlockedWeaponNode(newNode, weaponConfig, weaponData);
+                await this.setupUnlockedWeaponNode(newNode, weaponConfig, weaponData);
             }
         } else {
             if (this.lockedWeaponPrefab) {
@@ -327,7 +324,7 @@ export class UpgradeController extends Component {
     /**
      * 创建武器节点
      */
-    private createWeaponNode(weaponConfig: WeaponConfig, index: number) {
+    private async createWeaponNode(weaponConfig: WeaponConfig, index: number) {
         // 获取武器数据
         const weaponData = this.saveDataManager.getWeapon(weaponConfig.id);
         const isUnlocked = this.saveDataManager.isWeaponUnlocked(weaponConfig.id);
@@ -339,7 +336,7 @@ export class UpgradeController extends Component {
         if (isUnlocked) {
             if (this.unlockedWeaponPrefab) {
                 weaponNode = instantiate(this.unlockedWeaponPrefab);
-                this.setupUnlockedWeaponNode(weaponNode, weaponConfig, weaponData);
+                await this.setupUnlockedWeaponNode(weaponNode, weaponConfig, weaponData);
             }
         } else {
             if (this.lockedWeaponPrefab) {
@@ -365,17 +362,21 @@ export class UpgradeController extends Component {
     /**
      * 加载武器图标
      */
-    private loadWeaponSprite(sprite: Sprite, spritePath: string) {
-        // 参考WeaponBullet.ts的正确加载方式,在路径后添加'/spriteFrame'
-        const framePath = `${spritePath}/spriteFrame`;
-        resources.load(framePath, SpriteFrame, (err, spriteFrame) => {
-            if (!err && spriteFrame && sprite && sprite.isValid) {
+    private async loadWeaponSprite(sprite: Sprite, spritePath: string) {
+        // 转换路径格式,去除"images/"前缀
+        const bundlePath = spritePath.replace(/^images\//, '');
+        
+        try {
+            // 使用BundleLoader从images Bundle加载SpriteFrame
+            const spriteFrame = await this.bundleLoader.loadSpriteFrame('images', bundlePath);
+            
+            if (spriteFrame && sprite && sprite.isValid) {
                 sprite.spriteFrame = spriteFrame;
                 console.log(`武器图标加载成功: ${spritePath}`);
-            } else if (err) {
-                console.warn(`加载武器图标失败: ${spritePath}`, err);
             }
-        });
+        } catch (err) {
+            console.warn(`加载武器图标失败: ${spritePath}`, err);
+        }
     }
     
 
@@ -383,7 +384,7 @@ export class UpgradeController extends Component {
     /**
      * 设置已解锁武器节点(适配Unlock.prefab)
      */
-    private setupUnlockedWeaponNode(weaponNode: Node, weaponConfig: WeaponConfig, weaponData: any) {
+    private async setupUnlockedWeaponNode(weaponNode: Node, weaponConfig: WeaponConfig, weaponData: any) {
         // 获取公共的Sprite节点,避免重复查找
         const spriteNode = weaponNode.getChildByName('Sprite');
         if (!spriteNode) {
@@ -407,7 +408,7 @@ export class UpgradeController extends Component {
                            weaponConfig.visualConfig.weaponSprites['D-T'];
             }
             if (spritePath) {
-                this.loadWeaponSprite(weaponSprite, spritePath);
+                await this.loadWeaponSprite(weaponSprite, spritePath);
             }
         }
         
@@ -709,7 +710,7 @@ export class UpgradeController extends Component {
     /**
      * 升级武器
      */
-    private onUpgradeWeapon() {
+    private async onUpgradeWeapon() {
         console.log(`[UpgradeController] onUpgradeWeapon方法被调用`);
         
         if (!this.currentSelectedWeapon) {
@@ -787,7 +788,7 @@ export class UpgradeController extends Component {
             }
             
             // 使用新的状态切换方法更新武器节点
-            this.switchWeaponNodeState(this.currentSelectedWeapon);
+            await this.switchWeaponNodeState(this.currentSelectedWeapon);
             
             // 更新升级按钮闪烁状态(升级后钞票可能不足继续升级)
             this.updateUpgradeBtnBlinkState();
@@ -826,14 +827,14 @@ export class UpgradeController extends Component {
     /**
      * 解锁武器
      */
-    public unlockWeapon(weaponId: string): boolean {
+    public async unlockWeapon(weaponId: string): Promise<boolean> {
         const success = this.saveDataManager.unlockWeapon(weaponId);
         
         if (success) {
             console.log(`武器 ${weaponId} 解锁成功`);
             
             // 使用新的状态切换方法更新武器节点
-            this.switchWeaponNodeState(weaponId);
+            await this.switchWeaponNodeState(weaponId);
             
             // 保存数据
             this.saveDataManager.savePlayerData();
@@ -859,14 +860,14 @@ export class UpgradeController extends Component {
     /**
      * 刷新UI
      */
-    public refreshUI() {
-        this.refreshWeaponList();
+    public async refreshUI() {
+        await this.refreshWeaponList();
     }
     
     /**
      * 处理关卡完成事件,自动解锁相应武器
      */
-    private onLevelComplete() {
+    private async onLevelComplete() {
         if (!this.saveDataManager || !this.weaponsConfig) return;
         
         // 获取当前关卡数据
@@ -923,7 +924,7 @@ export class UpgradeController extends Component {
         
         // 如果有新解锁的武器,刷新UI并保存数据
         if (hasNewUnlocks) {
-            this.refreshWeaponList();
+            await this.refreshWeaponList();
             this.saveDataManager.savePlayerData();
             
             console.log(`[UpgradeController] 关卡完成后解锁了 ${newlyUnlockedWeapons.length} 个武器:`, newlyUnlockedWeapons);
@@ -967,9 +968,9 @@ export class UpgradeController extends Component {
     /**
      * 手动检查并解锁武器(用于调试或特殊情况)
      */
-    public checkAndUnlockWeapons() {
+    public async checkAndUnlockWeapons() {
         console.log('[UpgradeController] 手动检查武器解锁状态');
-        this.onLevelComplete();
+        await this.onLevelComplete();
     }
     
     /**
@@ -1018,7 +1019,7 @@ export class UpgradeController extends Component {
     /**
      * 强制同步所有武器解锁状态(用于修复数据不一致问题)
      */
-    public forceSyncWeaponUnlocks() {
+    public async forceSyncWeaponUnlocks() {
         if (!this.saveDataManager || !this.weaponsConfig) {
             console.error('[UpgradeController] 无法强制同步:数据管理器或武器配置未初始化');
             return false;
@@ -1047,7 +1048,7 @@ export class UpgradeController extends Component {
         
         if (syncCount > 0) {
             this.saveDataManager.savePlayerData();
-            this.refreshWeaponList();
+            await this.refreshWeaponList();
             console.log(`[UpgradeController] 强制同步完成,解锁了 ${syncCount} 个武器`);
         } else {
             console.log(`[UpgradeController] 强制同步完成,没有需要更新的武器`);

+ 31 - 48
assets/scripts/LevelSystem/BackgroundManager.ts

@@ -2,6 +2,7 @@ import { _decorator, Component, Node, Sprite, SpriteFrame, resources, find, asse
 import { LevelConfigManager } from './LevelConfigManager';
 import { SaveDataManager } from './SaveDataManager';
 import EventBus, { GameEvents } from '../Core/EventBus';
+import { BundleLoader } from '../Core/BundleLoader';
 
 const { ccclass, property } = _decorator;
 
@@ -16,12 +17,15 @@ export class BackgroundManager extends Component {
     private backgroundSprite: Sprite = null;
     private levelConfigManager: LevelConfigManager = null;
     private saveDataManager: SaveDataManager = null;
+    private bundleLoader: BundleLoader = null;
 
     onLoad() {
         // 获取关卡配置管理器
         this.levelConfigManager = LevelConfigManager.getInstance();
         // 获取SaveDataManager实例
         this.saveDataManager = SaveDataManager.getInstance();
+        // 获取BundleLoader实例
+        this.bundleLoader = BundleLoader.getInstance();
         // 监听关卡开始事件
         EventBus.getInstance().on(GameEvents.GAME_START, this.onGameStart, this);
     }
@@ -83,10 +87,12 @@ export class BackgroundManager extends Component {
         
         if (levelConfig && levelConfig.backgroundImage) {
             console.log(`[BackgroundManager] 关卡${currentLevel}配置的背景图片: ${levelConfig.backgroundImage}`);
-            this.setBackground(levelConfig.backgroundImage);
+            // 转换路径格式:从 "images/LevelBackground/BG1" 转换为 "LevelBackground/BG1"
+            const bundlePath = levelConfig.backgroundImage.replace('images/', '');
+            await this.setBackground(bundlePath);
         } else {
             // 使用默认背景
-            this.setBackground('images/LevelBackground/BG1');
+            await this.setBackground('LevelBackground/BG1');
             console.log(`[BackgroundManager] 关卡${currentLevel}未配置背景图片,使用默认背景`);
             if (levelConfig) {
                 console.log(`[BackgroundManager] 关卡配置中backgroundImage字段值:`, levelConfig.backgroundImage);
@@ -96,62 +102,37 @@ export class BackgroundManager extends Component {
 
     /**
      * 设置背景图片
-     * @param imagePath 图片路径(相对于resources目录)
+     * @param imagePath 图片路径(相对于images Bundle根目录)
      */
-    public setBackground(imagePath: string) {
+    public async setBackground(imagePath: string) {
         if (!this.backgroundSprite) {
             console.warn('[BackgroundManager] 背景Sprite组件未找到,无法设置背景');
             return;
         }
 
-        console.log(`[BackgroundManager] 开始加载背景图片: ${imagePath}`);
+        console.log(`[BackgroundManager] 开始从images Bundle加载背景图片: ${imagePath}`);
         
-        // 确保resources bundle已加载
-        const resourcesBundle = assetManager.getBundle('resources');
-        if (!resourcesBundle) {
-            console.warn('[BackgroundManager] resources bundle未找到,尝试加载...');
-            assetManager.loadBundle('resources', (err, bundle) => {
-                if (err) {
-                    console.error('[BackgroundManager] 加载resources bundle失败:', err);
-                    return;
-                }
-                this.loadBackgroundImage(bundle, imagePath);
-            });
-        } else {
-            this.loadBackgroundImage(resourcesBundle, imagePath);
-        }
-    }
-
-    /**
-     * 加载背景图片
-     */
-    private loadBackgroundImage(bundle: any, imagePath: string) {
-        // 正确的SpriteFrame子资源路径
-        const spriteFramePath = `${imagePath}/spriteFrame`;
-        
-        bundle.load(spriteFramePath, SpriteFrame, (err: any, spriteFrame: SpriteFrame) => {
-            if (!err && spriteFrame && this.backgroundSprite && this.backgroundSprite.isValid) {
+        try {
+            // 从images Bundle加载SpriteFrame
+            const spriteFrame = await this.bundleLoader.loadSpriteFrame(`${imagePath}/spriteFrame`);
+            
+            if (spriteFrame && this.backgroundSprite && this.backgroundSprite.isValid) {
                 this.backgroundSprite.spriteFrame = spriteFrame;
                 console.log(`[BackgroundManager] 背景图片加载成功: ${imagePath}`);
-            } else if (err) {
-                console.warn(`[BackgroundManager] 背景图片加载失败: ${spriteFramePath}`, err);
-                // 尝试使用resources.load作为备用方案
-                resources.load(spriteFramePath, SpriteFrame, (fallbackErr, fallbackSpriteFrame) => {
-                    if (!fallbackErr && fallbackSpriteFrame && this.backgroundSprite && this.backgroundSprite.isValid) {
-                        this.backgroundSprite.spriteFrame = fallbackSpriteFrame;
-                        console.log(`[BackgroundManager] 使用备用方案加载背景成功: ${imagePath}`);
-                    } else {
-                        // 尝试加载默认背景
-                        if (imagePath !== 'images/LevelBackground/BG1') {
-                            console.log('[BackgroundManager] 尝试加载默认背景');
-                            this.setBackground('images/LevelBackground/BG1');
-                        }
-                    }
-                });
             }
-        });
+        } catch (error) {
+            console.error(`[BackgroundManager] 背景图片加载失败: ${imagePath}`, error);
+            
+            // 如果不是默认背景,尝试加载默认背景
+            if (imagePath !== 'LevelBackground/BG1') {
+                console.log('[BackgroundManager] 尝试加载默认背景');
+                await this.setBackground('LevelBackground/BG1');
+            }
+        }
     }
 
+
+
     /**
      * 根据指定关卡设置背景图片
      * @param levelId 关卡ID
@@ -165,10 +146,12 @@ export class BackgroundManager extends Component {
         const levelConfig = await this.levelConfigManager.getLevelConfig(levelId);
         
         if (levelConfig && levelConfig.backgroundImage) {
-            this.setBackground(levelConfig.backgroundImage);
+            // 转换路径格式:从 "images/LevelBackground/BG1" 转换为 "LevelBackground/BG1"
+            const bundlePath = levelConfig.backgroundImage.replace('images/', '');
+            await this.setBackground(bundlePath);
         } else {
             // 使用默认背景
-            this.setBackground('images/LevelBackground/BG1');
+            await this.setBackground('LevelBackground/BG1');
             console.log(`[BackgroundManager] 关卡${levelId}未配置背景图片,使用默认背景`);
         }
     }

+ 3 - 3
assets/scripts/LevelSystem/GameManager.ts

@@ -845,7 +845,7 @@ export class GameManager extends Component {
         try {
             const levelConfig = await this.levelConfigManager.getLevelConfig(currentLevel);
             if (levelConfig) {
-                this.applyLevelConfig(levelConfig);
+                await this.applyLevelConfig(levelConfig);
             } else {
                 console.warn(`关卡 ${currentLevel} 配置加载失败`);
             }
@@ -854,12 +854,12 @@ export class GameManager extends Component {
         }
     }
     
-    private applyLevelConfig(levelConfig: any) {
+    private async applyLevelConfig(levelConfig: any) {
         console.log('[GameManager] 委托关卡配置应用给InGameManager');
         
         // 委托给InGameManager处理关卡配置
         if (this.inGameManager) {
-            this.inGameManager.applyLevelConfig(levelConfig);
+            await this.inGameManager.applyLevelConfig(levelConfig);
         } else {
             console.warn('[GameManager] InGameManager未初始化,无法应用关卡配置');
             

+ 6 - 4
assets/scripts/LevelSystem/IN_game.ts

@@ -1083,7 +1083,7 @@ export class InGameManager extends Component {
     /**
      * 应用关卡配置
      */
-    public applyLevelConfig(levelConfig: any) {
+    public async applyLevelConfig(levelConfig: any) {
         console.log('[InGameManager] 应用关卡配置');
         
         // 应用能量配置 - 现在从energyMaxUpgrades数组获取初始值
@@ -1150,12 +1150,14 @@ export class InGameManager extends Component {
         
         // 应用背景图片配置
         if (this.backgroundManager && levelConfig.backgroundImage) {
-            this.backgroundManager.setBackground(levelConfig.backgroundImage);
+            // 转换路径格式:从 "images/LevelBackground/BG1" 转换为 "LevelBackground/BG1"
+            const bundlePath = levelConfig.backgroundImage.replace('images/', '');
+            await this.backgroundManager.setBackground(bundlePath);
             console.log(`[InGameManager] 应用背景配置: ${levelConfig.backgroundImage}`);
         } else if (this.backgroundManager) {
             // 如果没有指定背景图片,使用默认背景
-            this.backgroundManager.setBackground('images/LevelBackground/BG1');
-            console.log('[InGameManager] 使用默认背景: images/LevelBackground/BG1');
+            await this.backgroundManager.setBackground('LevelBackground/BG1');
+            console.log('[InGameManager] 使用默认背景: LevelBackground/BG1');
         }
     }
     

+ 8 - 7
assets/scripts/LevelSystem/SaveDataManager.ts

@@ -1,4 +1,5 @@
 import { _decorator, sys, resources, JsonAsset } from 'cc';
+import { BundleLoader } from '../Core/BundleLoader';
 import { LevelConfigManager } from './LevelConfigManager';
 import EventBus, { GameEvents } from '../Core/EventBus';
 const { ccclass, property } = _decorator;
@@ -204,14 +205,14 @@ export class SaveDataManager {
      */
     private async loadWeaponsConfig(): Promise<void> {
         try {
-            const jsonAsset = await new Promise<any>((resolve, reject) => {
-                resources.load('data/weapons', (err, asset) => {
-                    if (err) reject(err);
-                    else resolve(asset);
-                });
-            });
+            const bundleLoader = BundleLoader.getInstance();
+            const weaponData = await bundleLoader.loadDataJson('weapons');
             
-            this.weaponsConfig = jsonAsset.json;
+            if (!weaponData) {
+                throw new Error('武器配置文件内容为空');
+            }
+            
+            this.weaponsConfig = weaponData.json as { weapons: any[] };
             console.log('[SaveDataManager] 武器配置加载成功');
         } catch (error) {
             console.error('[SaveDataManager] 加载武器配置失败:', error);