本文整理汇总了TypeScript中camelot-unchained.client.OnFriendlyTargetPositionChanged方法的典型用法代码示例。如果您正苦于以下问题:TypeScript client.OnFriendlyTargetPositionChanged方法的具体用法?TypeScript client.OnFriendlyTargetPositionChanged怎么用?TypeScript client.OnFriendlyTargetPositionChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类camelot-unchained.client
的用法示例。
在下文中一共展示了client.OnFriendlyTargetPositionChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: return
return (dispatch: (action: any) => any) => {
dispatch(init());
// Update avatar
client.OnFriendlyTargetGenderChanged((gender: Gender) =>
client.OnFriendlyTargetRaceChanged((race: Race) =>
dispatch(onAvatarChanged(getAvatar(gender, race))),
),
);
client.OnFriendlyTargetRaceChanged((race: Race) =>
client.OnFriendlyTargetGenderChanged((gender: Gender) => {
dispatch(onAvatarChanged(getAvatar(gender, race)));
}),
);
client.OnCharacterPositionChanged(_.throttle((x: number, y: number) =>
dispatch(onCharacterPositionChanged({ x, y })), 250));
client.OnFriendlyTargetPositionChanged(_.throttle((x: number, y: number) =>
dispatch(onTargetPositionChanged({ x, y })), 250));
// init handlers / events
events.on(events.clientEventTopics.handlesFriendlyTarget, (player: Player) => dispatch(onCharacterUpdate(player)));
};