fix(map): correct hero position calculation and loop order
修复了MissionHeroComp的遍历顺序,同时修正了MissionCardComp中的节点索引计算逻辑,匹配实际的视觉排布和MoveComp中的赋值规则,添加了调试日志方便排查位置问题。
This commit is contained in:
@@ -197,8 +197,8 @@ export class MissionHeroCompComp extends CCComp {
|
||||
|
||||
// 优先中路(1) -> 上路(0) -> 下路(2)
|
||||
const priority = [1, 0, 2];
|
||||
for (const lane of priority) {
|
||||
for (let indexInLane = 0; indexInLane < MissionHeroCompComp.HERO_LANE_CAP; indexInLane++) {
|
||||
for (let indexInLane = 0; indexInLane < MissionHeroCompComp.HERO_LANE_CAP; indexInLane++) {
|
||||
for (const lane of priority) {
|
||||
if (!occupied[lane][indexInLane]) {
|
||||
return { lane, indexInLane };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user