# Function: onBackpackItemSwap
▸ onBackpackItemSwap(handler
: BackpackItemSwapEventHandler): void
注册 背包物品交换 事件处理函数
example
import { backpackSystem } from '@timi/mogs-sdk';
backpackSystem.onBackpackItemSwap((event) => {
console.log('所属背包 ID:', event.backpackId);
console.log('对换的两个位置:', event.swappedPositions[0], swappedPositions[1]);
});
1
2
3
4
5
6
2
3
4
5
6
# 参数:
属性 | 类型 |
---|---|
handler | BackpackItemSwapEventHandler |
# 返回值:
void