头像入版 页面跳转优化

This commit is contained in:
2025-09-11 17:07:29 +08:00
parent d6a9898c8d
commit 6bf85c6ad8
74 changed files with 4238 additions and 1070 deletions
@@ -9,6 +9,7 @@ import { DataManager, DataId } from "../../data/DataManager";
import { GirlData } from "../../data/GirlData";
import proto from "db://assets/Scripts/proto/proto.pb.js";
import GameRootUI from "../../../Main/Common/GameRootUI";
import { UITransitionHelper } from "../../utils/UITransitionHelper";
const { ccclass, property } = _decorator;
@@ -23,7 +24,13 @@ export class GirlListPanel extends li_BaseView {
category: number;
openUIDataCT(data) {
this.category = data;
// 支持新的数据格式:既可以是单纯的数字,也可以是包含过渡动画信息的对象
this.category =
typeof data === "object" && data.category !== undefined
? data.category
: data;
const withAnimation = typeof data === "object" && data.withTransition;
}
onLoadCT() {
Utils.parseNode(this.node, this._nodeTab);
@@ -69,7 +76,37 @@ export class GirlListPanel extends li_BaseView {
GButton.BandClick(this._nodeTab.ReturnBtn, this.Return, this);
}
Return() {
this.onClose();
GameRootUI.I.showDefaultView();
console.log("GirlListPanel: Return button clicked");
// 执行同步的过渡动画:GirlListPanel向右滑出,ThemePanel从左滑入
const duration = 0.1;
let animationsCompleted = 0;
const totalAnimations = 2;
const onAnimationComplete = (source: string) => {
console.log(`GirlListPanel: Animation completed from ${source}`);
animationsCompleted++;
console.log(
`GirlListPanel: ${animationsCompleted}/${totalAnimations} animations completed`
);
if (animationsCompleted >= totalAnimations) {
console.log("GirlListPanel: All animations completed, closing panel");
// 所有动画完成后关闭当前面板
this.onClose();
}
};
// 1. GirlListPanel向右滑出
console.log("GirlListPanel: Starting slideOutToRight animation");
UITransitionHelper.slideOutToRight(this.node, duration, () =>
onAnimationComplete("slideOutToRight")
);
// 2. ThemePanel从左侧滑入
console.log("GirlListPanel: Starting ThemePanel slide_left animation");
GameRootUI.I.showDefaultViewWithTransition("slide_left", duration, () =>
onAnimationComplete("ThemePanel_slide_left")
);
}
}