public void SetCombatant(MT_Combatant c) { _who = c; if (c == null) { UN.SetActive(_visualBase, false); } else { UN.SetActive(_visualBase, true); UN.SetText(_nameText, c.Base.FullName); UN.SetFill(_healthBar, c.Base.GetPropertyRatio(BS_PropertyId.Health)); UN.SetFill(_apBar, c.Base.GetPropertyRatio(BS_PropertyId.ActionPoints)); UN.SetEnabled(_selectBtn, !c.Base.Team.IsAI); _icon.sprite = PT_Game.Data.Icons.GetIcon(c.Base.IconImageName); } }
void UpdateFields() { if (Dbg.Assert(Property != null)) { return; } UN.SetText(_nameField, Property.Id.ToString()); // might want a mapping for localization if (_showCurAndBaseInText) { UN.SetText(_curValueText, string.Format("{0}/{1}", Mathf.RoundToInt(Property.CurValue), Mathf.RoundToInt(Property.BaseValue))); } else { UN.SetText(_curValueText, Mathf.RoundToInt(Property.CurValue).ToString()); // might want a mapping for localization UN.SetText(_baseValueText, Mathf.RoundToInt(Property.BaseValue).ToString()); // might want a mapping for localization } UN.SetFill(_curValueImage, Property.CurValue); UN.SetFill(_baseValueImage, Property.BaseValue); }