Skip to content

ECS Framework API v2.1.50


ECS Framework API / AutoTyped

Function: AutoTyped()

AutoTyped(options?): (target, propertyKey) => void

Defined in: ECS/Core/SoAStorage.ts:194

自动类型推断装饰器 根据字段的默认值和数值范围自动选择最优的TypedArray类型

Parameters

options?

类型推断选项

minValue?

number

数值的最小值(用于范围优化)

maxValue?

number

数值的最大值(用于范围优化)

precision?

boolean

是否需要浮点精度(true: 使用浮点数组, false: 使用整数数组)

signed?

boolean

是否需要符号位(仅在整数模式下有效)

Returns

(target, propertyKey): void

Parameters

target

any

propertyKey

string | symbol

Returns

void

Released under the MIT License.