跳至主要內容

Class: bundle

muzzik大约 1 分钟

index / bundle

Class: bundle

bundle 管理器

Remarks

  • 封装(加载/预加载)场景为 load_scene

  • 支持(远程/本地) bundle

  • 支持 bundle 热更

  • 封装(bundle/scene)切换事件

  • 支持 bundle 管理器,用于子游戏管理

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new bundle()

Overrides

instance_base.constructor

Defined in

assets/@framework/resources/mk_bundle.ts:61open in new window

Properties

event

event: event_target<event_protocol>

事件

Defined in

assets/@framework/resources/mk_bundle.ts:97open in new window


pre_bundle_s

Optional pre_bundle_s: string

上个场景bundle

Defined in

assets/@framework/resources/mk_bundle.ts:99open in new window


pre_scene_s

pre_scene_s: string

上个场景名

Defined in

assets/@framework/resources/mk_bundle.ts:101open in new window


bundle_map

bundle_map: Map<string, bundle_data>

bundle列表

Defined in

assets/@framework/resources/mk_bundle.ts:103open in new window


switch_scene_b

switch_scene_b: boolean = false

切换场景状态

Defined in

assets/@framework/resources/mk_bundle.ts:105open in new window

Accessors

bundle_s

get bundle_s(): string

当前场景bundle

Returns

string

Defined in

assets/@framework/resources/mk_bundle.ts:108open in new window

set bundle_s(value_s_): void

Parameters

NameType
value_s_string

Returns

void

Defined in

assets/@framework/resources/mk_bundle.ts:112open in new window


scene_s

get scene_s(): string

当前场景名

Returns

string

Defined in

assets/@framework/resources/mk_bundle.ts:117open in new window

set scene_s(value_s): void

Parameters

NameType
value_sstring

Returns

void

Defined in

assets/@framework/resources/mk_bundle.ts:121open in new window

Methods

set

set(bundle_): void

设置 bundle 数据

Parameters

NameTypeDescription
bundle_bundle_databundle 信息

Returns

void

Defined in

assets/@framework/resources/mk_bundle.ts:142open in new window


load

load(args_): Promise<null | Bundle>

加载 bundle

Parameters

NameTypeDescription
args_string | load_configbundle 名 | 加载配置

Returns

Promise<null | Bundle>

Defined in

assets/@framework/resources/mk_bundle.ts:160open in new window


load_scene

load_scene(scene_s_, config_?): Promise<boolean>

切换场景

Parameters

NameTypeDescription
scene_s_string场景名
config_?Partial<switch_scene_config>切换配置

Returns

Promise<boolean>

Defined in

assets/@framework/resources/mk_bundle.ts:222open in new window


reload

reload(bundle_): Promise<null | Bundle>

重新加载 bundle

Parameters

NameType
bundle_bundle_info & Required<Pick<bundle_info, "origin_s">>

Returns

Promise<null | Bundle>

Defined in

assets/@framework/resources/mk_bundle.ts:341open in new window

📣 觉得很赞?分享给你的朋友吧!