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