Files
oops-plugin-framework/assets/core/gui/layer/Defines.ts
dgflash 40fdc0e16f 修复
1. oops.gui.remove(A, false); 销毁页面是不会销毁ui node
2. oops.gui.remove(A,true); 销毁时j界面时,还是不会销毁ui node。这就造成了资源泄露的问题
2023-01-09 11:59:32 +08:00

60 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* @Author: dgflash
* @Date: 2021-11-18 11:21:32
* @LastEditors: dgflash
* @LastEditTime: 2023-01-09 11:52:38
*/
import { Node } from "cc";
/*** 界面回调参数对象定义 */
export interface UICallbacks {
/**
* 节点添加到层级以后的回调
* @param node 当前界面节点
* @param params 外部传递参数
*/
onAdded?: (node: Node, params: any) => void,
/**
* 窗口节点 destroy 之后回调
* @param node 当前界面节点
* @param params 外部传递参数
*/
onRemoved?: (node: Node | null, params: any) => void,
/**
* 注意:调用`delete`或`$delete`才会触发此回调,如果`this.node.destroy()`,该回调将直接忽略。
*
* 如果指定onBeforeRemoved则next必须调用否则节点不会被正常删除。
*
* 比如希望节点做一个FadeOut然后删除则可以在`onBeforeRemoved`当中播放action动画动画结束后调用next
* @param node 当前界面节点
* @param next 回调方法
*/
onBeforeRemove?: (node: Node, next: Function) => void
}
/** 弹框层回调对象定义 */
export interface PopViewParams extends UICallbacks {
/** 是否触摸背景关闭弹窗 */
touchClose?: boolean,
/** 控制暗色背景的透明度 默认为190*/
opacity?: number;
}
/** 本类型仅供gui模块内部使用请勿在功能逻辑中使用 */
export class ViewParams {
/** 界面唯一标识 */
uuid: string = null!;
/** 预制路径 */
prefabPath: string = null!;
/** 传递给打开界面的参数 */
params: any = null!;
/** 窗口事件 */
callbacks: UICallbacks = null!;
/** 是否在使用状态 */
valid: boolean = true;
/** 界面根节点 */
node: Node = null!;
}