mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 19:07:30 +08:00
添加注释
This commit is contained in:
@@ -2,11 +2,18 @@ import { Node, __private } from "cc";
|
||||
import { oops } from "../../core/Oops";
|
||||
import { UICallbacks } from "../../core/gui/layer/Defines";
|
||||
import { ecs } from "../../libs/ecs/ECS";
|
||||
import { CompType } from "../../libs/ecs/ECSModel";
|
||||
import { CCComp } from "./CCComp";
|
||||
import { CCVMParentComp } from "./CCVMParentComp";
|
||||
import { CompType } from "../../libs/ecs/ECSModel";
|
||||
|
||||
export class ModuleUtil {
|
||||
/**
|
||||
* 添加界面组件
|
||||
* @param ent 模块实体
|
||||
* @param ctor 界面逻辑组件
|
||||
* @param uiId 界面资源编号
|
||||
* @param uiArgs 界面参数
|
||||
*/
|
||||
public static addView<T extends CCVMParentComp | CCComp>(
|
||||
ent: ecs.Entity,
|
||||
ctor: __private._types_globals__Constructor<T> | __private._types_globals__AbstractedConstructor<T>,
|
||||
@@ -21,6 +28,14 @@ export class ModuleUtil {
|
||||
oops.gui.open(uiId, uiArgs, uic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步添加视图层组件
|
||||
* @param ent 模块实体
|
||||
* @param ctor 界面逻辑组件
|
||||
* @param uiId 界面资源编号
|
||||
* @param uiArgs 界面参数
|
||||
* @returns 界面节点
|
||||
*/
|
||||
public static addViewAsync<T extends CCVMParentComp | CCComp>(
|
||||
ent: ecs.Entity,
|
||||
ctor: __private._types_globals__Constructor<T> | __private._types_globals__AbstractedConstructor<T>,
|
||||
@@ -38,6 +53,13 @@ export class ModuleUtil {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务实体上移除界面组件
|
||||
* @param ent 模块实体
|
||||
* @param ctor 界面逻辑组件
|
||||
* @param uiId 界面资源编号
|
||||
* @param isDestroy 是否释放界面缓存
|
||||
*/
|
||||
public static removeView(ent: ecs.Entity, ctor: CompType<ecs.IComp>, uiId: number, isDestroy: boolean = true) {
|
||||
ent.remove(ctor);
|
||||
oops.gui.remove(uiId, isDestroy);
|
||||
|
||||
Reference in New Issue
Block a user