using TMPro; using UnityEngine; using UnityEngine.UI; namespace NightclubArcadia.Skills { /// /// One skill row: name, numeric rank, and accent-tinted fill bar. /// public sealed class SkillRowView : MonoBehaviour { [SerializeField] TMP_Text nameLabel; [SerializeField] TMP_Text rankLabel; [SerializeField] Image barFill; [SerializeField] Image accentStripe; public void Bind(SkillDefinition def, int rank, int displayMaxRank) { if (def == null) { return; } if (nameLabel != null) { nameLabel.text = string.IsNullOrEmpty(def.DisplayName) ? def.Id.ToUpperInvariant() : def.DisplayName; nameLabel.color = def.AccentColor; } if (rankLabel != null) { rankLabel.text = rank.ToString(); } if (barFill != null) { var max = Mathf.Max(1, displayMaxRank); barFill.fillAmount = Mathf.Clamp01(rank / (float)max); barFill.color = def.AccentColor; } if (accentStripe != null) { accentStripe.color = def.AccentColor; } } } }