调整布局、新增导航栏,调整页面跳转逻辑

This commit is contained in:
2025-09-12 18:20:41 +08:00
parent c11a310ea1
commit 0e86ba3454
23 changed files with 4677 additions and 618 deletions
@@ -13,7 +13,7 @@ const { ccclass, property } = _decorator;
@ccclass("UITransitionHelper")
export class UITransitionHelper {
/**
* 让节点从右侧滑入到原位置
* 让节点从右侧滑入到屏幕中心
*
* @param {Node} node - 要执行动画的节点
* @param {number} duration - 动画持续时间(秒),默认0.3秒
@@ -21,7 +21,7 @@ export class UITransitionHelper {
*/
public static slideInFromRight(
node: Node,
duration: number = 0.1,
duration: number = 0.3,
callback?: Function
): void {
if (!node || !node.isValid) {
@@ -30,18 +30,18 @@ export class UITransitionHelper {
}
const screenWidth = view.getVisibleSize().width;
const originalPosition = node.getPosition();
const targetPosition = new Vec3(0, 0, 0);
// 设置初始位置为屏幕右侧外
node.setPosition(screenWidth, originalPosition.y, originalPosition.z);
node.setPosition(screenWidth, 0, 0);
// 执行滑入动画
// 执行滑入动画到屏幕中心
tween(node)
.to(
duration,
{ position: originalPosition },
{ position: targetPosition },
{
easing: "linear",
easing: "cubicOut",
}
)
.call(() => {
@@ -61,7 +61,7 @@ export class UITransitionHelper {
*/
public static slideOutToLeft(
node: Node,
duration: number = 0.1,
duration: number = 0.3,
callback?: Function
): void {
if (!node || !node.isValid) {
@@ -83,7 +83,7 @@ export class UITransitionHelper {
duration,
{ position: targetPosition },
{
easing: "linear",
easing: "cubicOut",
}
)
.call(() => {
@@ -95,7 +95,7 @@ export class UITransitionHelper {
}
/**
* 让节点从左侧滑入到原位置
* 让节点从左侧滑入到屏幕中心
*
* @param {Node} node - 要执行动画的节点
* @param {number} duration - 动画持续时间(秒),默认0.3秒
@@ -103,7 +103,7 @@ export class UITransitionHelper {
*/
public static slideInFromLeft(
node: Node,
duration: number = 0.1,
duration: number = 0.3,
callback?: Function
): void {
if (!node || !node.isValid) {
@@ -112,18 +112,18 @@ export class UITransitionHelper {
}
const screenWidth = view.getVisibleSize().width;
const originalPosition = node.getPosition();
const targetPosition = new Vec3(0, 0, 0);
// 设置初始位置为屏幕左侧外
node.setPosition(-screenWidth, originalPosition.y, originalPosition.z);
node.setPosition(-screenWidth, 0, 0);
// 执行滑入动画
// 执行滑入动画到屏幕中心
tween(node)
.to(
duration,
{ position: originalPosition },
{ position: targetPosition },
{
easing: "linear",
easing: "cubicOut",
}
)
.call(() => {
@@ -143,7 +143,7 @@ export class UITransitionHelper {
*/
public static slideOutToRight(
node: Node,
duration: number = 0.1,
duration: number = 0.3,
callback?: Function
): void {
if (!node || !node.isValid) {
@@ -165,7 +165,7 @@ export class UITransitionHelper {
duration,
{ position: targetPosition },
{
easing: "linear",
easing: "cubicOut",
}
)
.call(() => {