Skip to content

ECS Framework API v2.2.13


ECS Framework API / MigrationBuilder

Class: MigrationBuilder

Defined in: packages/core/src/ECS/Serialization/VersionMigration.ts:330

便捷的迁移构建器

提供链式API来定义迁移

Constructors

Constructor

new MigrationBuilder(): MigrationBuilder

Returns

MigrationBuilder

Methods

forComponent()

forComponent(componentType): this

Defined in: packages/core/src/ECS/Serialization/VersionMigration.ts:338

设置组件类型

Parameters

componentType

string

Returns

this


fromVersionToVersion()

fromVersionToVersion(from, to): this

Defined in: packages/core/src/ECS/Serialization/VersionMigration.ts:346

设置版本范围

Parameters

from

number

to

number

Returns

this


migrate()

migrate(migration): void

Defined in: packages/core/src/ECS/Serialization/VersionMigration.ts:355

注册迁移函数

Parameters

migration

ComponentMigrationFunction | SceneMigrationFunction

Returns

void

Released under the MIT License.