Files

39 lines
1.8 KiB
C#

using SepCore.Definition;
namespace SepCore.UI
{
public partial class StatForm
{
public void OnInit(StatContext context)
{
RefreshUI(context);
}
public void RefreshUI(StatContext context)
{
if (context == null)
{
UnityGameFramework.Runtime.Log.Error("StatForm.RefreshUI: context is null.");
return;
}
View.maxHpValue.text = context.GetFormattedValue(StatType.MaxHp);
View.hpRegenValue.text = context.GetFormattedValue(StatType.HpRegen);
View.lifeStealValue.text = context.GetFormattedValue(StatType.LifeSteal);
View.damagePercentValue.text = context.GetFormattedValue(StatType.DamagePercent);
View.meleeDamageValue.text = context.GetFormattedValue(StatType.MeleeDamage);
View.rangedDamageValue.text = context.GetFormattedValue(StatType.RangedDamage);
View.elementalDamageValue.text = context.GetFormattedValue(StatType.ElementalDamage);
View.attackSpeedValue.text = context.GetFormattedValue(StatType.AttackSpeed);
View.critChanceValue.text = context.GetFormattedValue(StatType.CritChance);
View.engineeringValue.text = context.GetFormattedValue(StatType.Engineering);
View.rangeValue.text = context.GetFormattedValue(StatType.Range);
View.armorValue.text = context.GetFormattedValue(StatType.Armor);
View.dodgeValue.text = context.GetFormattedValue(StatType.Dodge);
View.moveSpeedValue.text = context.GetFormattedValue(StatType.MoveSpeed);
View.harvestingValue.text = context.GetFormattedValue(StatType.Harvesting);
View.luckValue.text = context.GetFormattedValue(StatType.Luck);
}
}
}