refactor(mission): 优化节间过场表现与关卡流程

1. 新增地图滚动速度重置与背景动画加速逻辑,强化过场推进感
2. 重构节间过场流程,同步启动英雄归位与地图滚动
3. 调整关卡文本显示格式与字体大小,优化视觉体验
4. 新增全局移动锁控制英雄过场动画状态,修复动画残留问题
This commit is contained in:
panFD
2026-09-12 22:41:51 +08:00
parent 1b2545deec
commit 10e2c0d817
5 changed files with 74 additions and 28 deletions

View File

@@ -86,14 +86,35 @@ export default class MapLayer extends Component {
return [this.bg_anm, this.bg_anm1, this.bg_anm2, this.bg_anm3, this.bg_anm4].filter((a): a is Animation => a !== null);
}
/** 背景滚动播放速度倍率(节间过场加快推进感) */
private static readonly SCROLL_SPEED = 4;
public playAnimations(name?: string): void {
this.animations.forEach(a => name ? a.play(name) : a.play());
this.animations.forEach(a => {
a.play(name);
// 加快背景滚动速度,强化节间"向前推进"的观感(AnimationState.speed 属性)
const clip = a.defaultClip;
if (clip) {
const state = a.getState(clip.name);
if (state) state.speed = MapLayer.SCROLL_SPEED;
}
});
}
public stopAnimations(): void {
this.animations.forEach(a => a.stop());
}
/** 恢复背景滚动为正常速度(1x):大厅/非过场时调用,清除过场加速残留 */
public resetSpeed(): void {
this.animations.forEach(a => {
const clip = a.defaultClip;
if (!clip) return;
const state = a.getState(clip.name);
if (state) state.speed = 1;
});
}
public pauseAnimations(): void {
this.animations.forEach(a => a.pause());
}