本文整理汇总了TypeScript中camelot-unchained.client.OnCharacterRaceChanged方法的典型用法代码示例。如果您正苦于以下问题:TypeScript client.OnCharacterRaceChanged方法的具体用法?TypeScript client.OnCharacterRaceChanged怎么用?TypeScript client.OnCharacterRaceChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类camelot-unchained.client
的用法示例。
在下文中一共展示了client.OnCharacterRaceChanged方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: return
return (dispatch: (action: any) => any) => {
dispatch(init());
if (!hasClientAPI()) return;
// init handlers / events
client.OnCharacterStaminaChanged((current: number, max: number) => dispatch(staminaChanged(current, max)));
client.OnCharacterHealthChanged((current: number, max: number) => dispatch(healthChanged(current, max, BodyParts.Torso)));
client.OnCharacterNameChanged((name: string) => dispatch(nameChanged(name)));
client.OnCharacterRaceChanged((race: race) => dispatch(raceChanged(race)));
client.OnCharacterFactionChanged((faction: faction) => dispatch(factionChanged(faction)));
events.on(events.clientEventTopics.handlesCharacter, (player: Player) => dispatch(characterUpdate(player)));
};
示例2: return
return (dispatch: (action: any) => any) => {
dispatch(init());
// init handlers / events
client.OnCharacterStaminaChanged((current: number, max: number) => dispatch(onStaminaChanged(current, max)));
client.OnCharacterHealthChanged((current: number, max: number) =>
dispatch(onHealthChanged(current, max, BodyParts.Torso)));
client.OnCharacterInjuriesChanged((part: number, health: number, maxHealth: number) =>
dispatch(onHealthChanged(health, maxHealth, part)));
client.OnCharacterNameChanged((name: string) => dispatch(onNameChanged(name)));
client.OnCharacterFactionChanged((faction: Faction) => dispatch(onFactionChanged(faction)));
client.OnCharacterRaceChanged((race: Race) => {
dispatch(onRaceChanged(race));
client.OnCharacterGenderChanged((gender: Gender) => dispatch(onAvatarChanged(getAvatar(gender, race))));
});
events.on(events.clientEventTopics.handlesCharacter, (player: Player) => dispatch(onCharacterUpdate(player)));
};