Skip to content

Home > @esengine/ecs-framework-monorepo > SyncVarOptions

SyncVarOptions interface

SyncVar配置选项

Signature:

typescript
export interface SyncVarOptions<T = SyncVarValue>

Properties

Property

Modifiers

Type

Description

authority?

AuthorityType

(Optional) 权限类型

compression?

boolean

(Optional) 是否启用压缩

customDeserializer?

(value: unknown) => T

(Optional) 自定义反序列化函数

customSerializer?

(value: T) => unknown

(Optional) 自定义序列化函数

interpolation?

boolean

(Optional) 是否启用插值

mode?

SyncMode

(Optional) 同步模式

onChanged?

(oldValue: T, newValue: T) => void

(Optional) 变化回调函数

priority?

number

(Optional) 优先级(0-10,数值越高优先级越高)

scope?

NetworkScope

(Optional) 网络作用域

syncRate?

number

(Optional) 同步频率(毫秒)

threshold?

number

(Optional) 变化阈值,用于数值类型

基于 MIT 许可证发布