本文整理汇总了C#中PlayerStats.recalculatePlayerStats方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerStats.recalculatePlayerStats方法的具体用法?C# PlayerStats.recalculatePlayerStats怎么用?C# PlayerStats.recalculatePlayerStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerStats
的用法示例。
在下文中一共展示了PlayerStats.recalculatePlayerStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPointerClick
public void OnPointerClick(PointerEventData eventData){
playerStats = GameConstants.findPlayerInProject().GetComponent<ToonCharacter_PlayerScript>().getBasePlayer().playerStats;
if (!checkSkillPoints()) {
return;
}
if (!checkMaxLevel()) {
return;
}
skill.level++;
switch (skill.passiveSkillType) {
case Skill.passiveSkillType.WEAPON_LEVEL:
playerStats.weaponLevel++;
break;
case Skill.passiveSkillType.DYNAMIC_STRENGTH:
playerStats.playerDamageMultiplier = 1 + (skill.level * skill.damageMultiplier);
break;
case Skill.passiveSkillType.DYNAMIC_HEALTH:
playerStats.playerHealthMultiplier = 1 + (skill.level * skill.healthMultiplier);
break;
case Skill.passiveSkillType.DYNAMIC_REDUCTION:
playerStats.playerDamageReductionMultiplier = 0 + (skill.level * skill.damageReductionMultiplier);
break;
case Skill.passiveSkillType.STATIC_STRENGTH:
playerStats.playerStaticDamage = (skill.level * skill.staticDamage);
break;
case Skill.passiveSkillType.STATIC_HEALTH:
playerStats.playerStaticHealth = (skill.level * skill.staticHealth);
break;
}
Text skillText = transform.FindChild("SkillItem").gameObject.GetComponent<Image>().GetComponentInChildren<Text>();
skillText.text = skill.level + " / " + skill.maxLevel;
playerStats.skillPoints--;
playerStats.recalculatePlayerStats();
}