美术更新
- detail页面修改 - ui布局修改
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import { UITransitionHelper } from "../utils/UITransitionHelper";
|
||||
|
||||
/**
|
||||
* 导航管理器
|
||||
@@ -66,6 +67,43 @@ export class NavigationManager {
|
||||
ViewManager.I.openBundlesView("ChatPanel", roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 带过渡动画进入聊天页面
|
||||
* 从GirlDetailPanel平滑过渡到ChatPanel
|
||||
*
|
||||
* @param {number} roleId - 角色ID
|
||||
* @param {any} currentPanel - 当前面板实例(GirlDetailPanel)
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* NavigationManager.Instance.navigateToChatWithTransition(10001, this);
|
||||
* ```
|
||||
*/
|
||||
public navigateToChatWithTransition(roleId: number, currentPanel?: any): void {
|
||||
if (roleId == null || roleId <= 0) {
|
||||
console.warn("Invalid role ID for chat navigation with transition:", roleId);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Navigating to chat with transition, role ID: ${roleId}`);
|
||||
|
||||
// 打开ChatPanel,同时标记需要执行滑入动画
|
||||
ViewManager.I.openBundlesView("ChatPanel", {
|
||||
roleId: roleId,
|
||||
withSlideTransition: true
|
||||
}, (chatNode) => {
|
||||
// ChatPanel打开后,如果有当前面板,执行滑出动画
|
||||
if (currentPanel && currentPanel.node && currentPanel.node.isValid) {
|
||||
UITransitionHelper.slideOutToLeft(currentPanel.node, 0.3, () => {
|
||||
// 滑出动画完成后关闭原面板
|
||||
if (currentPanel.onClose && typeof currentPanel.onClose === 'function') {
|
||||
currentPanel.onClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入角色详情页面
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user