Browse Source

优化地图房间切片

chelios 3 years ago
parent
commit
d36a3a9fd0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      assets/Script/game/fight/map/FMap.ts

+ 2 - 2
assets/Script/game/fight/map/FMap.ts

@@ -266,7 +266,7 @@ export default class FMap extends cc.Component {
                 }
                 }
             }
             }
         }else{
         }else{
-            let targetX = targetPos.x - this.midWidth;
+            let targetX = room.x - this.midWidth;
             if(targetX < room.x){
             if(targetX < room.x){
                 targetX = room.x
                 targetX = room.x
             }
             }
@@ -315,7 +315,7 @@ export default class FMap extends cc.Component {
                 }
                 }
             }
             }
         }else{
         }else{
-            let targetY = targetPos.y - this.midHeidht;
+            let targetY = room.y - this.midHeidht;
             if(targetY < room.y){
             if(targetY < room.y){
                 targetY = room.y
                 targetY = room.y
             }
             }