# Function: onAttachedAttributeChange
▸ onAttachedAttributeChange(this
: void, handler
: AttachedAttributeChangeEventHandler): void
监听附加属性更新
# 参数:
属性 | 类型 | 描述 |
---|---|---|
this | void | - |
handler | AttachedAttributeChangeEventHandler | 事件触发的回调方法 |
AttachedAttributeChangeEventHandler: MogsEventHandler‹AttachedAttributeChangeEvent›
AttachedAttributeChangeEvent
结构
属性 | 类型 | 描述 |
---|---|---|
attributeId | number | 发生变化的属性id,对应attachedAttributeMap中的key值 |
currentValue | ReadonlyClone‹AttachedAttribute› | 数据改变后的值 |
itemId | string | 发生变化的物品id |
itemType | number | 发生变化的物品类型 |
previousValue | ReadonlyClone‹AttachedAttribute› | 数据改变前的值 |
type | AttachedAttributeChange | 事件类型,由具体的事件构造时提供 |
# 返回值:
void