feat(ui): 优化任务界面时间显示和阶段提示动画

- 移除时间显示中的波次前缀,仅保留分钟和秒数
- 调整阶段提示动画的激活时机,避免首次显示异常
- 修复阶段切换时的文本显示逻辑,显示当前波次进度
- 删除已废弃的 tip.prefab 资源文件
This commit is contained in:
panw
2026-04-24 09:25:10 +08:00
parent 9ac63859f1
commit c20be9f17b
4 changed files with 2354 additions and 2222 deletions

View File

@@ -237,7 +237,7 @@ export class MissionComp extends CCComp {
let m = Math.floor(remainSecond / 60);
let s = remainSecond % 60;
const wave = Math.max(1, this.currentWave || smc.vmdata.mission_data.level || 1);
let str = `W${wave.toString().padStart(2, '0')} ${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
let str = `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
if(str != this.lastTimeStr){
this.time_node.getChildByName("time").getComponent(Label).string = str;
this.lastTimeStr = str;
@@ -310,9 +310,13 @@ export class MissionComp extends CCComp {
return;
}
// 先激活节点,确保后续的组件刷新和渲染数据更新能正常生效
this.tooltip.active = true;
// 禁用 Widget 组件,防止其在 LateUpdate 中覆盖 tween 的位置修改
const widget = this.tooltip.getComponent(Widget);
if (widget) {
widget.updateAlignment(); // 强制刷新一次布局,防止第一次激活时尺寸未初始化
widget.enabled = false;
}
@@ -321,10 +325,10 @@ export class MissionComp extends CCComp {
const label = labNode.getComponent(Label);
if (label) {
label.string = phaseName;
label.updateRenderData(true); // 强制更新渲染数据,避免首次无文本
}
}
this.tooltip.active = true;
Tween.stopAllByTarget(this.tooltip);
// 动感动画设计:右侧进入 -> 屏幕中央(带有轻微的弹跳和滑动) -> 左侧飞出
@@ -374,7 +378,8 @@ export class MissionComp extends CCComp {
if (phaseNode) {
const label = phaseNode.getComponent(Label);
if (label) {
label.string = MissionComp.PhaseNameMap[targetPhase] || "未知";
const wave = Math.max(1, this.currentWave || (smc.vmdata && smc.vmdata.mission_data ? smc.vmdata.mission_data.level : 1) || 1);
label.string = `${wave}/20 波`;
}
// 阶段切换动感表现:针对阶段变化加入缩放与回弹动画,让流程充满心流体验