fix: 修正关卡怪物波次增长和卡片面板位置计算

- 将每波额外增加普通怪数量从1改为0,防止怪物数量无限增长
- 移除冗余的cardsPosReady标志,直接计算卡片隐藏位置
- 修复卡片隐藏位置计算,考虑父节点缩放比例
This commit is contained in:
walkpan
2026-03-26 23:21:53 +08:00
parent 76ca17ccdf
commit a291d227a0
2 changed files with 5 additions and 5 deletions

View File

@@ -61,7 +61,6 @@ export class MissionCardComp extends CCComp {
private heroInfoSyncTimer: number = 0;
private cardsShowPos: Vec3 = new Vec3();
private cardsHidePos: Vec3 = new Vec3();
private cardsPosReady: boolean = false;
private heroInfoItems: Map<number, {
node: Node,
model: HeroAttrsComp,
@@ -291,11 +290,12 @@ export class MissionCardComp extends CCComp {
}
private initCardsPanelPos() {
if (!this.cards_node || !this.cards_node.isValid || this.cardsPosReady) return;
if (!this.cards_node || !this.cards_node.isValid) return;
const pos = this.cards_node.position;
const parentScaleY = Math.max(0.001, Math.abs(this.cards_node.parent?.scale?.y ?? 1));
const localOffsetY = Math.abs(this.cardsBattleHideOffsetY) / parentScaleY;
this.cardsShowPos = new Vec3(pos.x, pos.y, pos.z);
this.cardsHidePos = new Vec3(pos.x, pos.y - Math.abs(this.cardsBattleHideOffsetY), pos.z);
this.cardsPosReady = true;
this.cardsHidePos = new Vec3(pos.x, pos.y - localOffsetY, pos.z);
}
private enterPreparePhase() {

View File

@@ -24,7 +24,7 @@ export class MissionMonCompComp extends CCComp {
@property({ tooltip: "每波基础普通怪数量" })
private baseMonstersPerWave: number = 5;
@property({ tooltip: "每波额外增加普通怪数量" })
private waveMonsterGrowth: number = 1;
private waveMonsterGrowth: number = 0;
@property({ tooltip: "多少波刷新一次 Boss" })
private bossWaveInterval: number = 5;
@property({ tooltip: "同一波内刷怪间隔(秒)" })