fix: 修正关卡怪物波次增长和卡片面板位置计算
- 将每波额外增加普通怪数量从1改为0,防止怪物数量无限增长 - 移除冗余的cardsPosReady标志,直接计算卡片隐藏位置 - 修复卡片隐藏位置计算,考虑父节点缩放比例
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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: "同一波内刷怪间隔(秒)" })
|
||||
|
||||
Reference in New Issue
Block a user