Browse Source

美术优化

181404010226 3 months ago
parent
commit
4f0066cffd

File diff suppressed because it is too large
+ 302 - 162
assets/Scenes/GameLevel.scene


+ 0 - 9
assets/resources/config.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.2.0",
-  "importer": "directory",
-  "imported": true,
-  "uuid": "d9287d85-a236-40fd-ad00-7c5d02f9ef16",
-  "files": [],
-  "subMetas": {},
-  "userData": {}
-}

BIN
assets/resources/images/UI/主界面/123213.png


+ 134 - 0
assets/resources/images/UI/主界面/123213.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e@6c48a",
+      "displayName": "123213",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e@f9941",
+      "displayName": "123213",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 318,
+        "height": 107,
+        "rawWidth": 318,
+        "rawHeight": 107,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -159,
+            -53.5,
+            0,
+            159,
+            -53.5,
+            0,
+            -159,
+            53.5,
+            0,
+            159,
+            53.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            107,
+            318,
+            107,
+            0,
+            0,
+            318,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -159,
+            -53.5,
+            0
+          ],
+          "maxPos": [
+            159,
+            53.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "36b9ebd0-7e22-4cc9-857a-0359e0c0d63e@6c48a"
+  }
+}

BIN
assets/resources/images/UI/主界面/213.png


+ 134 - 0
assets/resources/images/UI/主界面/213.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "7905016c-8f1b-49a0-adc5-177d092de514",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "7905016c-8f1b-49a0-adc5-177d092de514@6c48a",
+      "displayName": "213",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "7905016c-8f1b-49a0-adc5-177d092de514",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "7905016c-8f1b-49a0-adc5-177d092de514@f9941",
+      "displayName": "213",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 259,
+        "height": 97,
+        "rawWidth": 259,
+        "rawHeight": 97,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -129.5,
+            -48.5,
+            0,
+            129.5,
+            -48.5,
+            0,
+            -129.5,
+            48.5,
+            0,
+            129.5,
+            48.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            97,
+            259,
+            97,
+            0,
+            0,
+            259,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -129.5,
+            -48.5,
+            0
+          ],
+          "maxPos": [
+            129.5,
+            48.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "7905016c-8f1b-49a0-adc5-177d092de514@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "7905016c-8f1b-49a0-adc5-177d092de514@6c48a"
+  }
+}

BIN
assets/resources/images/UI/主界面/asdsad.png


+ 134 - 0
assets/resources/images/UI/主界面/asdsad.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "7a8b2bda-6558-417c-acfe-f47bf47266c6",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "7a8b2bda-6558-417c-acfe-f47bf47266c6@6c48a",
+      "displayName": "asdsad",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "7a8b2bda-6558-417c-acfe-f47bf47266c6",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "7a8b2bda-6558-417c-acfe-f47bf47266c6@f9941",
+      "displayName": "asdsad",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0.5,
+        "offsetY": -1,
+        "trimX": 2,
+        "trimY": 4,
+        "width": 98,
+        "height": 88,
+        "rawWidth": 101,
+        "rawHeight": 94,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -49,
+            -44,
+            0,
+            49,
+            -44,
+            0,
+            -49,
+            44,
+            0,
+            49,
+            44,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            2,
+            90,
+            100,
+            90,
+            2,
+            2,
+            100,
+            2
+          ],
+          "nuv": [
+            0.019801980198019802,
+            0.02127659574468085,
+            0.9900990099009901,
+            0.02127659574468085,
+            0.019801980198019802,
+            0.9574468085106383,
+            0.9900990099009901,
+            0.9574468085106383
+          ],
+          "minPos": [
+            -49,
+            -44,
+            0
+          ],
+          "maxPos": [
+            49,
+            44,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "7a8b2bda-6558-417c-acfe-f47bf47266c6@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "7a8b2bda-6558-417c-acfe-f47bf47266c6@6c48a"
+  }
+}

+ 40 - 2
assets/scripts/CombatSystem/BlockManager.ts

@@ -71,6 +71,25 @@ export class BlockManager extends Component {
     })
     public block3PriceNode: Node = null;
     
+    // db标签节点装饰器
+    @property({
+        type: Node,
+        tooltip: '拖拽Block1的db标签节点到这里(Canvas/GameLevelUI/BlockSelectionUI/diban/kuang/Block1/db01)'
+    })
+    public block1DbNode: Node = null;
+    
+    @property({
+        type: Node,
+        tooltip: '拖拽Block2的db标签节点到这里(Canvas/GameLevelUI/BlockSelectionUI/diban/kuang/Block2/db01)'
+    })
+    public block2DbNode: Node = null;
+    
+    @property({
+        type: Node,
+        tooltip: '拖拽Block3的db标签节点到这里(Canvas/GameLevelUI/BlockSelectionUI/diban/kuang/Block3/db01)'
+    })
+    public block3DbNode: Node = null;
+    
     // 金币标签节点
     @property({
         type: Node,
@@ -1161,8 +1180,6 @@ export class BlockManager extends Component {
                 const location = this.blockLocations.get(block);
                 
                 if (location === 'grid') {
-                    this.hidePriceLabel(block);
-                    
                     const dbNode = block['dbNode'];
                     if (dbNode) {
                         dbNode.active = false;
@@ -2107,6 +2124,24 @@ export class BlockManager extends Component {
         return true;
     }
     
+    /**
+     * 显示所有db标签节点
+     */
+    showAllDbNodes() {
+        if (this.block1DbNode) {
+            this.block1DbNode.active = true;
+            console.log("显示Block1的db标签节点");
+        }
+        if (this.block2DbNode) {
+            this.block2DbNode.active = true;
+            console.log("显示Block2的db标签节点");
+        }
+        if (this.block3DbNode) {
+            this.block3DbNode.active = true;
+            console.log("显示Block3的db标签节点");
+        }
+    }
+
     // 刷新方块 - 重新生成三个新的武器方块
     public refreshBlocks() {
         // 移除PlacedBlocks容器中所有方块的标签
@@ -2132,6 +2167,9 @@ export class BlockManager extends Component {
         // 生成新的方块
         this.generateRandomBlocksInKuang();
         
+        // 显示所有db标签节点
+        this.showAllDbNodes();
+        
     }
 
     // 检查是否有已放置的方块

+ 1 - 1
assets/scripts/CombatSystem/BlockSelection/BlockTag.ts

@@ -81,7 +81,7 @@ export class BlockTag {
         }
         
         if (removedCount > 0) {
-            console.log(`[BlockTag] 从容器 ${containerNode.name} 中移除了 ${removedCount} 个方块的标签`);
+            // 从容器中移除方块标签
         }
     }
 }

+ 97 - 192
assets/scripts/CombatSystem/BlockSelection/GameBlockSelection.ts

@@ -18,7 +18,7 @@ export class GameBlockSelection extends Component {
         type: Node,
         tooltip: '拖拽diban/ann001按钮节点到这里'
     })
-    public addBallButton: Node = null;
+     public addBallButton: Node = null;
 
     @property({
         type: Node,
@@ -114,7 +114,6 @@ export class GameBlockSelection extends Component {
     private debugGraphics: Graphics = null;
 
     onEnable() {
-        console.log('[GameBlockSelection] onEnable() 节点被激活');
         // 如果还未初始化,则进行初始化
         if (!this.isInitialized) {
             this.initializeComponent();
@@ -126,7 +125,6 @@ export class GameBlockSelection extends Component {
     }
 
     start() {
-        console.log('[GameBlockSelection] start() 被调用');
         // 如果还未初始化,则进行初始化
         if (!this.isInitialized) {
             this.initializeComponent();
@@ -181,7 +179,7 @@ export class GameBlockSelection extends Component {
         // 标记为已初始化
         this.isInitialized = true;
         
-        console.log('GameBlockSelection.initializeComponent() 初始化完成');
+        // 初始化完成
     }
 
     // 设置事件监听器
@@ -203,7 +201,7 @@ export class GameBlockSelection extends Component {
     }
     // 处理游戏开始事件
     private onGameStartEvent() {
-        //console.log('[GameBlockSelection] 接收到游戏开始事件,允许生成方块');
+        // 接收到游戏开始事件,允许生成方块
         this.shouldGenerateBlocks = true;
     }
     
@@ -226,7 +224,7 @@ export class GameBlockSelection extends Component {
                 // 重新设置拖拽事件
                 this.setupBlockDragEvents(block);
             } else {
-                console.warn('[GameBlockSelection] 跳过无效方块的拖拽事件设置');
+                // 跳过无效方块的拖拽事件设置
             }
         }
     }
@@ -293,7 +291,7 @@ export class GameBlockSelection extends Component {
             // 通过事件系统创建新的小球
             const eventBus = EventBus.getInstance();
             eventBus.emit(GameEvents.BALL_CREATE_ADDITIONAL);
-            console.log(`新增小球成功,扣除${actualCost}金币`);
+            // 新增小球成功
         }
     }
 
@@ -322,7 +320,7 @@ export class GameBlockSelection extends Component {
 
         // 扣除金币
         if (this.session.spendCoins(actualCost)) {
-            console.log(`[GameBlockSelection] 成功扣除 ${actualCost} 金币`);
+            // 成功扣除金币
             this.updateCoinDisplay();
             
             // 刷新方块
@@ -332,13 +330,13 @@ export class GameBlockSelection extends Component {
                 // 找到PlacedBlocks容器
                 const placedBlocksContainer = find('Canvas/GameLevelUI/PlacedBlocks');
                 if (placedBlocksContainer) {
-                    console.log('[GameBlockSelection] 移除已放置方块的标签');
+                    // 移除已放置方块的标签
                     // 移除已放置方块的标签
                     BlockTag.removeTagsInContainer(placedBlocksContainer);
                 }
                 
                 // 刷新方块
-                console.log('[GameBlockSelection] 调用 blockManager.refreshBlocks()');
+                // 调用 blockManager.refreshBlocks()
                 this.blockManager.refreshBlocks();
                 
                 // 等待一帧确保方块生成完成
@@ -384,7 +382,7 @@ export class GameBlockSelection extends Component {
     
     // 播放diban下滑动画
     private playDibanSlideDownAnimation() {
-        console.log('[GameBlockSelection] 开始播放diban下滑动画');
+        // 开始播放diban下滑动画
         
         // 使用装饰器属性获取Camera节点上的GameStartMove组件
         if (!this.cameraNode) {
@@ -401,7 +399,7 @@ export class GameBlockSelection extends Component {
         // 调用GameStartMove的下滑动画方法
         (gameStartMove as any).slideDibanDownAndHide(0.3);
         
-        console.log('[GameBlockSelection] 已调用GameStartMove的diban下滑动画');
+        // 已调用GameStartMove的diban下滑动画
     }
 
     // 保存已放置的方块(从GameManager迁移)
@@ -433,7 +431,7 @@ export class GameBlockSelection extends Component {
             if (label) {
                 const coins = this.session.getCoins();
                 label.string = coins.toString();
-                console.log(`[GameBlockSelection] 更新金币显示: ${coins}`);
+                // 更新金币显示
             } else {
                 console.warn('[GameBlockSelection] coinLabelNode缺少Label组件');
             }
@@ -450,27 +448,22 @@ export class GameBlockSelection extends Component {
             duration: 3.0
         });
         
-        console.log('金币不足!');
+        // 金币不足
     }
 
     // === 公共方法:供GameManager调用 ===
 
     // 生成方块选择(不再控制UI显示,只负责生成方块)
     public generateBlockSelection() {
-        console.log('[GameBlockSelection] generateBlockSelection开始执行');
-        
         // 直接生成方块,不再依赖shouldGenerateBlocks标志
         if (this.blockManager) {
             this.blockManager.refreshBlocks();
-            console.log('[GameBlockSelection] 生成新的随机方块');
         } else {
             console.warn('[GameBlockSelection] BlockManager未找到,无法生成随机方块');
         }
 
         // 触发进入备战状态事件
         EventBus.getInstance().emit(GameEvents.ENTER_BATTLE_PREPARATION);
-        
-        console.log('[GameBlockSelection] 方块生成完成');
     }
 
    
@@ -484,8 +477,6 @@ export class GameBlockSelection extends Component {
 
     // 统一的方块占用情况刷新方法
     public refreshGridOccupation() {
-        console.log('[GameBlockSelection] 刷新方块占用情况');
-        
         if (this.blockManager) {
              this.blockManager.resetGridOccupation();
             
@@ -494,7 +485,6 @@ export class GameBlockSelection extends Component {
             if (placedBlocksContainer) {
                 for (let i = 0; i < placedBlocksContainer.children.length; i++) {
                     const block = placedBlocksContainer.children[i];
-                    console.log(`[GameBlockSelection] 刷新方块占用情况,方块${i}`, block);
                     
                     // 按照BlockManager.tryPlaceBlockToGrid的正确方法获取位置
                     let b1Node = block;
@@ -510,21 +500,15 @@ export class GameBlockSelection extends Component {
                     const b1WorldPos = b1Node.parent.getComponent(UITransform).convertToWorldSpaceAR(b1Node.position);
                     const gridPos = this.blockManager.gridContainer.getComponent(UITransform).convertToNodeSpaceAR(b1WorldPos);
                     
-                    console.log(`[GameBlockSelection] B1世界坐标:`, b1WorldPos);
-                    console.log(`[GameBlockSelection] 网格本地坐标:`, gridPos);
-                    
                     // 重新标记方块占用的网格位置
                     const gridNode = this.blockManager.findNearestGridNode(gridPos);
                     if (gridNode) {
                         this.blockManager.markOccupiedPositions(block, gridNode);
-                        console.log(`[GameBlockSelection] 方块 ${block.name} 重新标记到网格 ${gridNode.name}`);
                     } else {
                         console.warn(`[GameBlockSelection] 方块 ${block.name} 未找到对应的网格节点`);
                     }
                 }
             }
-            
-            console.log('[GameBlockSelection] 方块占用情况刷新完成');
         } else {
             console.warn('[GameBlockSelection] BlockManager未找到,无法刷新占用情况');
         }
@@ -534,23 +518,17 @@ export class GameBlockSelection extends Component {
 
     // 重置方块选择状态
     public resetSelection() {
-        console.log('[GameBlockSelection] 重置方块选择状态');
-        
         // 重置方块生成标志,等待下次onBattle触发
         this.shouldGenerateBlocks = false;
-        console.log('[GameBlockSelection] 重置方块生成标志');
         
         // 注意:不再直接调用blockManager.onGameReset(),因为StartGame.clearGameStates()
         // 已经通过RESET_BLOCK_MANAGER事件触发了BlockManager的重置,避免重复生成方块
-        console.log('[GameBlockSelection] BlockManager将通过事件系统自动重置');
         
         // 清理所有方块标签
         BlockTag.clearAllTags();
-        console.log('[GameBlockSelection] 方块标签已清理');
     
         // 更新金币显示
         this.updateCoinDisplay();
-        console.log('[GameBlockSelection] 金币显示已更新');
     }
 
     // 检查是否有上阵方块
@@ -573,38 +551,26 @@ export class GameBlockSelection extends Component {
 
     // 显示没有上阵方块的Toast提示
     private showNoPlacedBlocksToast() {
-        console.log('[GameBlockSelection] 显示未上阵植物提示');
-        
         // 使用事件机制显示Toast
         EventBus.getInstance().emit(GameEvents.SHOW_TOAST, {
             message: '请至少上阵一个植物!',
             duration: 3.0
         });
-        
-        console.log('[GameBlockSelection] 请至少上阵一个植物!');
     }
     
     // 设置方块拖拽事件
     public setupBlockDragEvents(block: Node) {
         block.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
-            console.log('[GameBlockSelection] TOUCH_START - gameStarted:', this.blockManager.gameStarted);
-            
             // 检查游戏是否已开始
             if (!this.blockManager.gameStarted) {
-                console.log('[GameBlockSelection] 游戏未开始,拒绝拖拽');
                 return;
             }
             
             // 只对grid区域的方块检查移动限制,kuang区域的方块可以自由拖拽
             const blockLocation = this.blockManager.blockLocations.get(block);
-            console.log('[GameBlockSelection] 方块位置:', blockLocation, '可移动检查:', blockLocation === 'grid' ? this.canMoveBlock(block) : true);
             
-            if (blockLocation === 'grid' && !this.canMoveBlock(block)) {
-                console.log('[GameBlockSelection] grid区域方块移动被限制');
-                return;
-            }
+            // grid区域的方块目前允许自由移动
             
-            console.log('[GameBlockSelection] 开始拖拽方块,位置:', blockLocation);
             this.currentDragBlock = block;
             this.startPos = event.getUILocation();
             this.blockStartPos.set(block.position);
@@ -627,9 +593,8 @@ export class GameBlockSelection extends Component {
             
             // 只对grid区域的方块检查移动限制,kuang区域的方块可以自由拖拽
             const blockLocation = this.blockManager.blockLocations.get(block);
-            if (blockLocation === 'grid' && !this.canMoveBlock(block)) {
-                return;
-            }
+            
+            // grid区域的方块目前允许自由移动
             
             if (!this.currentDragBlock) return;
             
@@ -642,9 +607,6 @@ export class GameBlockSelection extends Component {
                 this.blockStartPos.y + deltaY,
                 this.blockStartPos.z
             );
-            
-            // 更新调试绘制
-            // this.updateDebugDraw();
         }, this);
         
         block.on(Node.EventType.TOUCH_END, async (event: EventTouch) => {
@@ -655,9 +617,8 @@ export class GameBlockSelection extends Component {
             
             // 只对grid区域的方块检查移动限制,kuang区域的方块可以自由拖拽
             const blockLocation = this.blockManager.blockLocations.get(block);
-            if (blockLocation === 'grid' && !this.canMoveBlock(block)) {
-                return;
-            }
+            
+            // grid区域的方块目前允许自由移动
             
             if (this.currentDragBlock) {
                 try {
@@ -675,9 +636,6 @@ export class GameBlockSelection extends Component {
                 // 拖拽结束时恢复碰撞体
                 const collider = block.getComponent(Collider2D);
                 if (collider) collider.enabled = true;
-                
-                // 更新调试绘制
-                // this.updateDebugDraw();
             }
         }, this);
         
@@ -693,20 +651,13 @@ export class GameBlockSelection extends Component {
                 const collider = block.getComponent(Collider2D);
                 if (collider) collider.enabled = true;
                 
-                // 更新调试绘制
-                // this.updateDebugDraw();
+
             }
         }, this);
     }
     
-    // 检查方块是否可以移动
-    private canMoveBlock(block: Node): boolean {
-        return true;
-    }
-    
     // 处理方块放下
     private async handleBlockDrop(event: EventTouch) {
-        console.log("事件:处理方块放下");
         try {
             const touchPos = event.getLocation();
             const startLocation = this.currentDragBlock['startLocation'];
@@ -717,16 +668,11 @@ export class GameBlockSelection extends Component {
                     this.returnBlockToKuang(startLocation);
                 } else {
                     // 没有标签的方块不能放回kuang,返回原位置
-                    console.log(`[GameBlockSelection] 方块 ${this.currentDragBlock.name} 没有标签,不能放回kuang区域`);
                     this.returnBlockToOriginalPosition();
                 }
             } else if (this.blockManager.tryPlaceBlockToGrid(this.currentDragBlock)) {
                 await this.handleSuccessfulPlacement(startLocation);
             } else {
-                console.log(`[GameBlockSelection] 方块 ${this.currentDragBlock.name} 放置到网格失败`);
-                console.log(`[GameBlockSelection] 方块标签状态:`, BlockTag.hasTag(this.currentDragBlock));
-                console.log(`[GameBlockSelection] 方块UUID:`, this.currentDragBlock.uuid);
-                
                 // 放置失败,尝试直接与重叠方块合成
                 if (this.blockManager.tryMergeOnOverlap(this.currentDragBlock)) {
                     // 合成成功时,若来自 kuang 则扣费
@@ -736,7 +682,6 @@ export class GameBlockSelection extends Component {
                     }
                     // 当前拖拽块已被销毁(合并时),无需复位
                 } else {
-                    console.log(`[GameBlockSelection] 方块 ${this.currentDragBlock.name} 合成也失败,返回原位置`);
                     this.returnBlockToOriginalPosition();
                 }
             }
@@ -842,7 +787,7 @@ export class GameBlockSelection extends Component {
             const weaponNode = b1Node.getChildByName('Weapon');
             if (weaponNode) {
                 weaponNode.setScale(0.45, 0.45, 1);
-                console.log(`[GameBlockSelection] 方块返回kuang区域,设置植物图标缩放: 0.45倍`);
+                // 方块返回kuang区域,设置植物图标缩放: 0.45倍
             }
         }
         
@@ -852,11 +797,8 @@ export class GameBlockSelection extends Component {
             this.currentDragBlock['placedBefore'] = false;
         }
         
-        const dbNode = this.currentDragBlock['dbNode'];
-        if (dbNode) {
-            dbNode.active = true;
-            this.currentDragBlock.emit(Node.EventType.TRANSFORM_CHANGED);
-        }
+        // 显示对应的db标签节点
+        this.showDbNodeByBlockLocation(this.currentDragBlock);
     }
     
     /**
@@ -864,7 +806,6 @@ export class GameBlockSelection extends Component {
      * @param block 方块节点
      */
     private attachWeaponInfoToBlock(block: Node): void {
-        console.log(`[GameBlockSelection] 添加武器信息`);
         try {
             // 查找方块中的Weapon节点
             const weaponNode = this.findWeaponNodeInBlock(block);
@@ -876,7 +817,6 @@ export class GameBlockSelection extends Component {
             // 检查是否已经有WeaponInfo组件
             let weaponInfo = weaponNode.getComponent(WeaponInfo);
             if (weaponInfo) {
-                console.log(`[GameBlockSelection] 武器节点 ${weaponNode.name} 已有WeaponInfo组件,跳过添加`);
                 return;
             }
             
@@ -888,7 +828,6 @@ export class GameBlockSelection extends Component {
             if (weaponConfig) {
                 // 设置武器配置到WeaponInfo组件
                 weaponInfo.setWeaponConfig(weaponConfig);
-                console.log(`[GameBlockSelection] 成功为武器节点 ${weaponNode.name} 添加武器信息组件,武器: ${weaponConfig.name}`);
             } else {
                 console.warn(`[GameBlockSelection] 方块 ${block.name} 没有武器配置,无法设置武器信息`);
                 // 移除刚添加的组件
@@ -928,6 +867,32 @@ export class GameBlockSelection extends Component {
         return findWeaponRecursive(block);
     }
     
+    // 根据方块位置隐藏对应的db标签节点
+    private hideDbNodeByBlockLocation(block: Node) {
+        const originalLocation = this.getBlockOriginalLocation(block);
+        
+        if (originalLocation === 'block1' && this.blockManager.block1DbNode) {
+            this.blockManager.block1DbNode.active = false;
+        } else if (originalLocation === 'block2' && this.blockManager.block2DbNode) {
+            this.blockManager.block2DbNode.active = false;
+        } else if (originalLocation === 'block3' && this.blockManager.block3DbNode) {
+            this.blockManager.block3DbNode.active = false;
+        }
+    }
+    
+    // 根据方块位置显示对应的db标签节点
+    private showDbNodeByBlockLocation(block: Node) {
+        const originalLocation = this.getBlockOriginalLocation(block);
+        
+        if (originalLocation === 'block1' && this.blockManager.block1DbNode) {
+            this.blockManager.block1DbNode.active = true;
+        } else if (originalLocation === 'block2' && this.blockManager.block2DbNode) {
+            this.blockManager.block2DbNode.active = true;
+        } else if (originalLocation === 'block3' && this.blockManager.block3DbNode) {
+            this.blockManager.block3DbNode.active = true;
+        }
+    }
+    
     // 处理成功放置
     private async handleSuccessfulPlacement(startLocation: string) {
         try {
@@ -936,12 +901,9 @@ export class GameBlockSelection extends Component {
             if (startLocation === 'grid') {
                 this.blockManager.clearTempStoredOccupiedGrids(this.currentDragBlock);
                 this.blockManager.blockLocations.set(this.currentDragBlock, 'grid');
-                this.blockManager.hidePriceLabel(this.currentDragBlock);
                 
-                const dbNode = this.currentDragBlock['dbNode'];
-                if (dbNode) {
-                    dbNode.active = false;
-                }
+                // 隐藏对应的db标签节点
+                this.hideDbNodeByBlockLocation(this.currentDragBlock);
                 
                 // 立即将方块移动到PlacedBlocks节点下,不等游戏开始
                 this.blockManager.moveBlockToPlacedBlocks(this.currentDragBlock);
@@ -952,29 +914,22 @@ export class GameBlockSelection extends Component {
                 // 如果游戏已开始,添加锁定视觉提示
                 if (this.blockManager.gameStarted) {
                     this.blockManager.addLockedVisualHint(this.currentDragBlock);
-                    
-                    // 游戏开始后放置的方块移除标签,不能再放回kuang
                     BlockTag.removeTag(this.currentDragBlock);
                 }
 
                 // 检查并执行合成
                 try {
-                    console.log(`[GameBlockSelection] 尝试合成方块 ${this.currentDragBlock.name}`);
                     await this.blockManager.tryMergeBlock(this.currentDragBlock);
                 } catch (mergeError) {
                     console.error('[GameBlockSelection] 方块合成时发生错误:', mergeError);
-                    // 合成失败不影响方块放置,只记录错误
                 }
             } else {
                 if (this.blockManager.deductPlayerCoins(price)) {
                     this.blockManager.clearTempStoredOccupiedGrids(this.currentDragBlock);
                     this.blockManager.blockLocations.set(this.currentDragBlock, 'grid');
-                    this.blockManager.hidePriceLabel(this.currentDragBlock);
                     
-                    const dbNode = this.currentDragBlock['dbNode'];
-                    if (dbNode) {
-                        dbNode.active = false;
-                    }
+                    // 隐藏对应的db标签节点
+                    this.hideDbNodeByBlockLocation(this.currentDragBlock);
                     
                     this.currentDragBlock['placedBefore'] = true;
                     
@@ -1025,110 +980,30 @@ export class GameBlockSelection extends Component {
             this.currentDragBlock.position = this.blockStartPos.clone();
         }
         
-        // 清除拖动状态,恢复价格标签显示
+        // 清除拖动状态,恢复db节点显示
         this.currentDragBlock['isDragging'] = false;
         
-        this.blockManager.showPriceLabel(this.currentDragBlock);
+        this.showDbNodeByBlockLocation(this.currentDragBlock);
         
-        const dbNode = this.currentDragBlock['dbNode'];
-        if (dbNode) {
-            dbNode.active = true;
-            this.currentDragBlock.emit(Node.EventType.TRANSFORM_CHANGED);
-        }
+        this.currentDragBlock.emit(Node.EventType.TRANSFORM_CHANGED);
     }
 
     // === 调试绘制相关方法 ===
     
-    // 初始化调试绘制
     private initDebugDraw() {
-        // if (!this.debugDrawSnapRange) return;
-        // 
-        // // 创建调试绘制节点
-        // this.debugDrawNode = new Node('DebugDraw');
-        // this.debugGraphics = this.debugDrawNode.addComponent(Graphics);
-        // 
-        // // 将调试绘制节点添加到场景中
-        // if (this.gridContainer && this.gridContainer.parent) {
-        //     this.gridContainer.parent.addChild(this.debugDrawNode);
-        // }
-        // 
-        // console.log('[GameBlockSelection] 调试绘制初始化完成');
+        // 调试绘制功能已禁用
     }
     
-    // 绘制网格吸附范围
     private drawGridSnapRanges() {
-        // if (!this.debugDrawSnapRange || !this.debugGraphics || !this.blockManager) return;
-        // 
-        // this.debugGraphics.strokeColor = Color.GREEN;
-        // this.debugGraphics.lineWidth = 2;
-        // 
-        // // 通过BlockManager获取网格信息来绘制吸附范围
-        // const gridSpacing = this.blockManager.getGridSpacing(); // 动态获取网格间距
-        // const snapRange = gridSpacing * 0.8; // 吸附范围
-        // 
-        // // 遍历所有网格位置,绘制吸附范围
-        // for (let row = 0; row < 6; row++) {
-        //     for (let col = 0; col < 11; col++) {
-        //         // 计算网格世界坐标
-        //         const gridWorldPos = this.blockManager.getGridWorldPosition(row, col);
-        //         if (!gridWorldPos) continue;
-        //         
-        //         // 转换为调试绘制节点的本地坐标
-        //         const localPos = new Vec3();
-        //         this.debugDrawNode.getComponent(UITransform).convertToNodeSpaceAR(gridWorldPos, localPos);
-        //         
-        //         // 绘制网格吸附范围圆圈
-        //         this.debugGraphics.circle(localPos.x, localPos.y, snapRange);
-        //         this.debugGraphics.stroke();
-        //     }
-        // }
+        // 调试绘制功能已禁用
     }
     
-    // 绘制方块吸附范围
     private drawBlockSnapRange(block: Node) {
-        // if (!this.debugDrawSnapRange || !this.debugGraphics || !block || !this.blockManager) return;
-        // 
-        // // 绘制方块吸附点
-        // this.debugGraphics.strokeColor = Color.RED;
-        // this.debugGraphics.fillColor = Color.RED;
-        // this.debugGraphics.lineWidth = 3;
-        // 
-        // const blockParts = this.blockManager.getBlockParts(block);
-        // const gridSpacing = this.blockManager.getGridSpacing(); // 动态获取网格间距
-        // const snapRange = gridSpacing * 0.6; // 吸附范围
-        // 
-        // blockParts.forEach(part => {
-        //     const worldPos = part.node.getWorldPosition();
-        //     const localPos = new Vec3();
-        //     this.debugDrawNode.getComponent(UITransform).convertToNodeSpaceAR(worldPos, localPos);
-        //     
-        //     // 绘制红色十字标记吸附点
-        //     const crossSize = 10;
-        //     this.debugGraphics.moveTo(localPos.x - crossSize, localPos.y);
-        //     this.debugGraphics.lineTo(localPos.x + crossSize, localPos.y);
-        //     this.debugGraphics.moveTo(localPos.x, localPos.y - crossSize);
-        //     this.debugGraphics.lineTo(localPos.x, localPos.y + crossSize);
-        //     this.debugGraphics.stroke();
-        //     
-        //     // 绘制吸附范围圆圈
-        //     this.debugGraphics.circle(localPos.x, localPos.y, snapRange);
-        //     this.debugGraphics.stroke();
-        // });
+        // 调试绘制功能已禁用
     }
     
-    // 更新调试绘制
     private updateDebugDraw() {
-        // if (!this.debugDrawSnapRange || !this.debugGraphics) return;
-        // 
-        // this.debugGraphics.clear();
-        // 
-        // // 绘制网格吸附范围
-        // this.drawGridSnapRanges();
-        // 
-        // // 如果有正在拖拽的方块,绘制其吸附范围
-        // if (this.currentDragBlock) {
-        //     this.drawBlockSnapRange(this.currentDragBlock);
-        // }
+        // 调试绘制功能已禁用
     }
     
     // 清理调试绘制
@@ -1140,17 +1015,9 @@ export class GameBlockSelection extends Component {
         }
     }
     
-    // 设置调试绘制开关
     public setDebugDrawSnapRange(enabled: boolean) {
         this.debugDrawSnapRange = enabled;
-        
-        // if (enabled) {
-        //     this.initDebugDraw();
-        // } else {
-        //     this.cleanupDebugDraw();
-        // }
-        
-        console.log(`[GameBlockSelection] 调试绘制已${enabled ? '开启' : '关闭'}`);
+        // 调试绘制功能已禁用
     }
 
     onDisable() {
@@ -1170,4 +1037,42 @@ export class GameBlockSelection extends Component {
         eventBus.off(GameEvents.GAME_START, this.onGameStartEvent, this);
         eventBus.off(GameEvents.SETUP_BLOCK_DRAG_EVENTS, this.onSetupBlockDragEventsEvent, this);
     }
+    
+    /**
+     * 获取方块的原始位置
+     * @param block 方块节点
+     * @returns 原始位置标识符
+     */
+    private getBlockOriginalLocation(block: Node): string | null {
+        // 检查方块是否在block1Container中
+        if (this.blockManager.block1Container && this.isBlockInContainer(block, this.blockManager.block1Container)) {
+            return 'block1';
+        }
+        // 检查方块是否在block2Container中
+        if (this.blockManager.block2Container && this.isBlockInContainer(block, this.blockManager.block2Container)) {
+            return 'block2';
+        }
+        // 检查方块是否在block3Container中
+        if (this.blockManager.block3Container && this.isBlockInContainer(block, this.blockManager.block3Container)) {
+            return 'block3';
+        }
+        return null;
+    }
+    
+    /**
+     * 检查方块是否在指定容器中
+     * @param block 方块节点
+     * @param container 容器节点
+     * @returns 是否在容器中
+     */
+    private isBlockInContainer(block: Node, container: Node): boolean {
+        let parent = block.parent;
+        while (parent) {
+            if (parent === container) {
+                return true;
+            }
+            parent = parent.parent;
+        }
+        return false;
+    }
 }

+ 7 - 7
assets/scripts/CombatSystem/BlockSelection/WeaponInfo.ts

@@ -91,7 +91,7 @@ export class WeaponInfo extends Component {
             this._currentAmmo = -1;
         }
         
-        console.log(`[WeaponInfo] 武器配置已设置: ${config.name} (${config.id})`);
+        // 武器配置已设置
     }
     
     /**
@@ -156,7 +156,7 @@ export class WeaponInfo extends Component {
         this.weaponLevel = this._weaponLevel;
         this.weaponDamage = this.getDamage();
         
-        console.log(`[WeaponInfo] 武器等级已设置为: ${level}`);
+        // 武器等级已设置
     }
     
     /**
@@ -185,7 +185,7 @@ export class WeaponInfo extends Component {
         // 更新编辑器面板可见属性
         this.activeStatus = this._isActive;
         
-        console.log(`[WeaponInfo] 武器激活状态已设置为: ${active}`);
+        // 武器激活状态已设置
     }
     
     /**
@@ -311,7 +311,7 @@ export class WeaponInfo extends Component {
         // 更新编辑器面板可见属性
         this.totalDamage = this._totalDamageDealt;
         
-        console.log(`[WeaponInfo] 累计伤害增加 ${damage},总伤害: ${this._totalDamageDealt}`);
+        // 累计伤害已更新
     }
     
     /**
@@ -331,7 +331,7 @@ export class WeaponInfo extends Component {
         // 更新编辑器面板可见属性
         this.killCount = this._killCount;
         
-        console.log(`[WeaponInfo] 击杀数增加,当前击杀数: ${this._killCount}`);
+        // 击杀数已更新
     }
     
     /**
@@ -355,7 +355,7 @@ export class WeaponInfo extends Component {
         this.killCount = this._killCount;
         this.remainingCooldown = 0;
         
-        console.log(`[WeaponInfo] 武器统计数据已重置`);
+        // 武器统计数据已重置
     }
     
     /**
@@ -402,7 +402,7 @@ export class WeaponInfo extends Component {
         this.weaponLevel = this._weaponLevel;
         this.weaponDamage = this.getDamage();
         
-        console.log(`[WeaponInfo] 武器 ${this.getWeaponName()} 升级到等级 ${this._weaponLevel}`);
+        // 武器升级完成
         return true;
     }
     

+ 1 - 47
assets/scripts/CombatSystem/Wall.ts

@@ -254,11 +254,7 @@ export class Wall extends Component {
      * 根据等级获取墙体血量
      */
     public getWallHealthByLevel(level: number): number {
-        // 优先使用SaveDataManager的方法,保持配置一致性
-        if (this.saveDataManager) {
-            return this.saveDataManager.getWallHealthByLevel(level);
-        }
-        // 备用方案:使用本地配置
+        // 使用本地配置
         return this.wallHpMap[level] || (100 + (level - 1) * 200);
     }
 
@@ -269,49 +265,7 @@ export class Wall extends Component {
         return this.saveDataManager?.getWallLevel() || 1;
     }
 
-    /**
-     * 升级墙体等级
-     * 返回升级后信息,失败返回null
-     */
-    public upgradeWallLevel(): { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null {
-        if (!this.saveDataManager) return null;
-
-        // 检查是否可以升级
-        if (!this.saveDataManager.canUpgradeWall()) return null;
-
-        // 获取升级费用并扣除钞票
-        const cost = this.saveDataManager.getWallUpgradeCost();
-        if (!this.saveDataManager.spendMoney(cost)) return null;
 
-        // 执行升级
-        if (!this.saveDataManager.upgradeWallLevel()) return null;
-
-        const newLvl = this.saveDataManager.getWallLevel();
-        const baseNewHp = this.getWallHealthByLevel(newLvl);
-        const actualNewHp = this.getWallHealthByLevel(newLvl); // 使用当前等级的基础血量
-
-        // 更新内存中的数值为当前等级的基础血量
-        const previousHealth = this.currentHealth;
-        this.currentHealth = actualNewHp;
-        
-        // 触发墙体血量变化事件,标记为升级事件
-        const eventBus = EventBus.getInstance();
-        eventBus.emit(GameEvents.WALL_HEALTH_CHANGED, {
-            previousHealth: previousHealth,
-            currentHealth: this.currentHealth,
-            maxHealth: this.getMaxHealth(),
-            isUpgrade: true
-        });
-        
-        this.updateHealthDisplay();
-
-        return {
-            currentLevel: newLvl,
-            currentHp: actualNewHp,
-            nextLevel: newLvl + 1,
-            nextHp: this.getWallHealthByLevel(newLvl + 1) // 这里返回基础血量用于显示
-        };
-    }
 
     /**
      * 恢复墙体血量

+ 82 - 18
assets/scripts/FourUI/MainSystem/MainUIControlller.ts

@@ -1,5 +1,5 @@
 // MainUIController.ts
-import { _decorator, Component, Node, Button, Label } from 'cc';
+import { _decorator, Component, Node, Button, Label, JsonAsset, resources } from 'cc';
 import { SaveDataManager } from '../../LevelSystem/SaveDataManager';
 import { GameManager, AppState } from '../../LevelSystem/GameManager';
 import { GameState } from '../../LevelSystem/IN_game';
@@ -21,6 +21,11 @@ export class MainUIController extends Component {
   @property(Button) upgradeBtn: Button = null;       // 升级按钮
   @property(Node) upgradeCostLabel: Node = null;     // 消耗钞票数字
   @property(Node) upgradeHpLabel: Node = null;       // 升级后血量数字
+  @property(Label) upgradeCurrentHpLabel: Label = null;  // 当前血量Label
+  @property(Label) upgradeNextHpLabel: Label = null;     // 升级后血量Label
+
+  /* 墙体配置 */
+  @property(JsonAsset) wallConfigAsset: JsonAsset = null;  // 墙体配置JSON资源
 
   /* 主功能按钮 */
   @property(Node) battleBtn: Node = null;            // 战斗
@@ -39,11 +44,13 @@ export class MainUIController extends Component {
   @property(Node) moneyAniNode: Node = null;          // MoneyAni节点
 
   private sdm: SaveDataManager = null;
+  private wallConfig: any = null;
 
   onLoad () {
     console.log('[MainUIController] onLoad 开始执行');
     
     this.sdm = SaveDataManager.getInstance();
+    this.loadWallConfig();
     this.sdm.initialize();
     console.log('[MainUIController] SaveDataManager 初始化完成');
 
@@ -88,6 +95,59 @@ export class MainUIController extends Component {
     console.log('[MainUIController] bindButtons 执行完成');
   }
 
+  /* ================= 配置加载 ================= */
+  
+  /**
+   * 加载墙体配置
+   */
+  private loadWallConfig(): void {
+    try {
+      if (this.wallConfigAsset && this.wallConfigAsset.json) {
+        this.wallConfig = this.wallConfigAsset.json;
+        console.log('[MainUIController] 墙体配置加载成功:', this.wallConfig);
+        
+        // 将配置传递给SaveDataManager
+        this.sdm.setWallConfig(this.wallConfig);
+      } else {
+        console.error('[MainUIController] wallConfigAsset未设置或无效');
+      }
+    } catch (error) {
+      console.error('[MainUIController] 加载墙体配置失败:', error);
+    }
+  }
+  
+  /**
+   * 获取墙体升级费用
+   */
+  private getWallUpgradeCost(level: number): number {
+    if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.upgradeCosts) {
+      const costs = this.wallConfig.wallConfig.upgradeCosts;
+      return costs[level.toString()] || 0;
+    }
+    return 0;
+  }
+  
+  /**
+   * 获取墙体血量
+   */
+  private getWallHealthByLevel(level: number): number {
+    if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.healthByLevel) {
+      const healthByLevel = this.wallConfig.wallConfig.healthByLevel;
+      return healthByLevel[level.toString()] || 100;
+    }
+    return 100;
+  }
+  
+  /**
+   * 获取墙体最大等级
+   */
+  private getWallMaxLevel(): number {
+    if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.maxLevel) {
+      return this.wallConfig.wallConfig.maxLevel;
+    }
+    return 5;
+  }
+
   /* ================= 业务逻辑 ================= */
   private upgradeWallHp () {
     // 播放UI点击音效
@@ -103,12 +163,12 @@ export class MainUIController extends Component {
     // 打印当前状态用于调试
     const currentMoney = this.sdm.getMoney();
     const currentWallLevel = this.sdm.getWallLevel();
-    const upgradeCost = this.sdm.getWallUpgradeCost();
+    const upgradeCost = this.getWallUpgradeCost(currentWallLevel);
     
     console.log(`[MainUIController] 当前状态: 钞票=${currentMoney}, 墙体等级=${currentWallLevel}, 升级费用=${upgradeCost}`);
     
     // 检查墙体等级是否已达到最大值
-    const maxLevel = this.sdm.getWallMaxLevel();
+    const maxLevel = this.getWallMaxLevel();
     if (currentWallLevel >= maxLevel) {
       console.log('[MainUIController] 墙体已达到最大等级');
       EventBus.getInstance().emit(GameEvents.SHOW_TOAST, {
@@ -147,7 +207,7 @@ export class MainUIController extends Component {
     
     // 通知墙体组件更新血量显示
     const newLevel = this.sdm.getWallLevel();
-    const newHealth = this.sdm.getWallHealthByLevel(newLevel);
+    const newHealth = this.getWallHealthByLevel(newLevel);
     EventBus.getInstance().emit(GameEvents.WALL_HEALTH_CHANGED, {
       previousHealth: 0,
       currentHealth: newHealth,
@@ -267,25 +327,29 @@ export class MainUIController extends Component {
     const costLbl = this.upgradeCostLabel?.getComponent(Label);
     const hpLbl = this.upgradeHpLabel?.getComponent(Label);
     
-    if (!costLbl || !hpLbl) {
-      console.error('[MainUIController] 升级信息标签未找到:', { costLbl: !!costLbl, hpLbl: !!hpLbl });
-      return;
-    }
-
     // 显示升级费用
-    const cost = this.sdm.getWallUpgradeCost();
-    costLbl.string = cost.toString();
-    console.log(`[MainUIController] 升级费用: ${cost}`);
+    const currentLevel = this.sdm.getWallLevel();
+    const cost = this.getWallUpgradeCost(currentLevel);
+    if (costLbl) {
+      costLbl.string = cost.toString();
+      console.log(`[MainUIController] 升级费用: ${cost}`);
+    }
 
     // 显示当前和下一级血量
-    const currentLevel = this.sdm.getWallLevel();
-    const currentHp = this.sdm.getWallHealthByLevel(currentLevel);
+    const currentHp = this.getWallHealthByLevel(currentLevel);
     
     // 计算下一级血量 - 使用配置数据
-    const nextHp = this.sdm.getWallHealthByLevel(currentLevel + 1);
-    
-    hpLbl.string = `${currentHp}>>${nextHp}`;
-    console.log(`[MainUIController] 血量显示: ${currentHp}>>${nextHp}, 当前等级: ${currentLevel}`);
+    const nextHp = this.getWallHealthByLevel(currentLevel + 1);
+    
+    // 如果有新的分离Label,使用分离显示
+    if (this.upgradeCurrentHpLabel && this.upgradeNextHpLabel) {
+      this.upgradeCurrentHpLabel.string = `${currentHp}>>`;
+      this.upgradeNextHpLabel.string = `${nextHp}`;
+      console.log(`[MainUIController] 分离血量显示: 当前=${currentHp}, 升级后=${nextHp}, 当前等级: ${currentLevel}`);
+    }else {
+      console.error('[MainUIController] 升级信息标签未找到');
+      return;
+    }
     
     // 升级按钮始终保持可点击状态,通过Toast显示各种提示
     console.log(`[MainUIController] 升级按钮保持可交互状态`);

+ 1 - 7
assets/scripts/LevelSystem/GameManager.ts

@@ -942,13 +942,7 @@ export class GameManager extends Component {
         return this.wallComponent ? this.wallComponent.getCurrentHealth() : 100;
     }
 
-    public upgradeWallLevel(): { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null {
-        if (this.inGameManager) {
-            return this.inGameManager.upgradeWallLevel();
-        }
-        // 备用方案:直接访问墙体组件
-        return this.wallComponent ? this.wallComponent.upgradeWallLevel() : null;
-    }
+
 
     // 初始化GameBlockSelection组件
     public initGameBlockSelection() {

+ 0 - 23
assets/scripts/LevelSystem/IN_game.ts

@@ -802,30 +802,7 @@ export class InGameManager extends Component {
         };
     }
     
-    /**
-     * 升级墙体等级(升级主墙体)
-     */
-    public upgradeWallLevel(): { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null {
-        if (this.wallComponent) {
-            return this.wallComponent.upgradeWallLevel();
-        }
-        return null;
-    }
 
-    /**
-     * 升级所有墙体等级
-     */
-    public upgradeAllWallsLevel(): {
-        main: { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null;
-        topFence: { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null;
-        bottomFence: { currentLevel: number; currentHp: number; nextLevel: number; nextHp: number } | null;
-    } {
-        return {
-            main: this.wallComponent ? this.wallComponent.upgradeWallLevel() : null,
-            topFence: this.topFenceComponent ? this.topFenceComponent.upgradeWallLevel() : null,
-            bottomFence: this.bottomFenceComponent ? this.bottomFenceComponent.upgradeWallLevel() : null
-        };
-    }
     
     /**
      * 根据等级获取墙体健康度

+ 11 - 91
assets/scripts/LevelSystem/SaveDataManager.ts

@@ -160,6 +160,14 @@ export class SaveDataManager {
     // 私有属性
     private weaponsConfig: { weapons: any[] } = null;
     private wallConfig: any = null;
+  
+  /**
+   * 设置墙体配置(从MainUIController传递)
+   */
+  public setWallConfig(config: any): void {
+    this.wallConfig = config;
+    console.log('[SaveDataManager] 接收到墙体配置:', this.wallConfig);
+  }
     
     // 最近的奖励记录(用于UI显示)
     private lastRewards: {money: number, diamonds: number} = {money: 0, diamonds: 0};
@@ -188,7 +196,7 @@ export class SaveDataManager {
         
         this.loadPlayerData();
         await this.loadWeaponsConfig();
-        await this.loadWallConfig();
+
         this.initialized = true;
     }
     
@@ -212,25 +220,7 @@ export class SaveDataManager {
         }
     }
     
-    /**
-     * 加载墙体配置
-     */
-    private async loadWallConfig(): Promise<void> {
-        try {
-            const jsonAsset = await new Promise<any>((resolve, reject) => {
-                resources.load('data/wall', (err, asset) => {
-                    if (err) reject(err);
-                    else resolve(asset);
-                });
-            });
-            
-            this.wallConfig = jsonAsset.json;
-            console.log('[SaveDataManager] 墙体配置加载成功:', this.wallConfig);
-        } catch (error) {
-            console.error('[SaveDataManager] 加载墙体配置失败:', error);
-            this.wallConfig = null;
-        }
-    }
+
     
     /**
      * 加载玩家数据
@@ -721,83 +711,13 @@ export class SaveDataManager {
     public upgradeWallLevel(): boolean {
         if (!this.playerData) return false;
         
-        const maxLevel = this.getWallMaxLevel();
-        if (this.playerData.wallLevel >= maxLevel) return false;
-        
         this.playerData.wallLevel += 1;
         
-        // 从配置文件获取墙体血量
-        this.playerData.wallBaseHealth = this.getWallHealthByLevel(this.playerData.wallLevel);
-        
         this.savePlayerData(true);
         return true;
     }
     
-    /**
-     * 获取墙体升级费用
-     */
-    public getWallUpgradeCost(): number {
-        if (!this.playerData) return 0;
-        
-        // 从配置文件获取升级费用
-        if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.upgradeCosts) {
-            const costs = this.wallConfig.wallConfig.upgradeCosts;
-            return costs[this.playerData.wallLevel.toString()] || 0;
-        }
-        
-        // 默认费用
-        const defaultCosts: Record<number, number> = {
-            1: 100,   // 1级升2级
-            2: 500,   // 2级升3级
-            3: 1000,  // 3级升4级
-            4: 2000   // 4级升5级
-        };
-        
-        return defaultCosts[this.playerData.wallLevel] || 0;
-    }
-    
-    /**
-     * 获取墙体最大等级
-     */
-    public getWallMaxLevel(): number {
-        if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.maxLevel) {
-            return this.wallConfig.wallConfig.maxLevel;
-        }
-        return 5; // 默认最高5级
-    }
-    
-    /**
-     * 根据等级获取墙体血量
-     */
-    public getWallHealthByLevel(level: number): number {
-        if (this.wallConfig && this.wallConfig.wallConfig && this.wallConfig.wallConfig.healthByLevel) {
-            const healthByLevel = this.wallConfig.wallConfig.healthByLevel;
-            return healthByLevel[level.toString()] || (100 + (level - 1) * 200);
-        }
-        
-        // 默认血量映射(与wall.json保持一致)
-        const defaultHealthMap: Record<number, number> = {
-            1: 100,
-            2: 500,
-            3: 1200,
-            4: 1500,
-            5: 2000
-        };
-        return defaultHealthMap[level] || (100 + (level - 1) * 200);
-    }
-    
-    /**
-     * 检查是否可以升级墙体
-     */
-    public canUpgradeWall(): boolean {
-        if (!this.playerData) return false;
-        
-        const maxLevel = this.getWallMaxLevel();
-        if (this.playerData.wallLevel >= maxLevel) return false;
-        
-        const cost = this.getWallUpgradeCost();
-        return this.playerData.money >= cost;
-    }
+
     
     // === 道具和武器管理 ===
     

Some files were not shown because too many files changed in this diff