# Class ModuleUtil

#### Hierarchy

- ModuleUtil

- Defined in assets/module/common/ModuleUtil.ts:10

#####
Index

### Constructors

constructor

### Methods

addView
addViewUi
addViewUiAsync
removeViewUi

## Constructors

### constructor

- new ModuleUtil(): ModuleUtil

- #### Returns ModuleUtil

## Methods

### `Static` addView

- addView<T>(ent: ECSEntity, ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>, parent: Node, url: string): void

- 添加界面组件

  #### Type Parameters

  - #### T extends CCComp | CCVMParentComp

  #### Parameters

  - ##### ent: ECSEntity

    模块实体

  - ##### ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>

    界面逻辑组件

  - ##### parent: Node

    显示对象父级

  - ##### url: string

    显示资源地址

  #### Returns void

  - Defined in assets/module/common/ModuleUtil.ts:79

### `Static` addViewUi

- addViewUi<T>(ent: ECSEntity, ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>, uiId: number, uiArgs?: any): void

- 添加界面组件

  #### Type Parameters

  - #### T extends CCComp | CCVMParentComp

  #### Parameters

  - ##### ent: ECSEntity

    模块实体

  - ##### ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>

    界面逻辑组件

  - ##### uiId: number

    界面资源编号

  - ##### uiArgs: any = null

    界面参数

  #### Returns void

  - Defined in assets/module/common/ModuleUtil.ts:18

### `Static` addViewUiAsync

- addViewUiAsync<T>(ent: ECSEntity, ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>, uiId: number, uiArgs?: any): Promise<null | Node>

- 异步添加视图层组件

  ### Returns

  界面节点

  #### Type Parameters

  - #### T extends CCComp | CCVMParentComp

  #### Parameters

  - ##### ent: ECSEntity

    模块实体

  - ##### ctor: __types_globals__Constructor<T> | __types_globals__AbstractedConstructor<T>

    界面逻辑组件

  - ##### uiId: number

    界面资源编号

  - ##### uiArgs: any = null

    界面参数

  #### Returns Promise<null | Node>

  - Defined in assets/module/common/ModuleUtil.ts:40

### `Static` removeViewUi

- removeViewUi(ent: ECSEntity, ctor: CompType< IComp >, uiId: number, isDestroy?: boolean): void

- 业务实体上移除界面组件

  #### Parameters

  - ##### ent: ECSEntity

    模块实体

  - ##### ctor: CompType< IComp >

    界面逻辑组件

  - ##### uiId: number

    界面资源编号

  - ##### `Optional` isDestroy: boolean

    是否释放界面缓存

  #### Returns void

  - Defined in assets/module/common/ModuleUtil.ts:67

Generated using TypeDoc