TraitPanelUI
Overview
Detail panel for the selected trait. Shows title, description, icon, and swaps the description panel frame based on the trait’s cost type. Integrates with I2 Localization and updates when the selection changes.
Serialized
- ChairmanTraitVariable
selectedTrait - TraitNode
startingSelectedTrait - UI:
TextMeshProUGUI titleText,descText,Image traitIcon - Frame:
Image traitDescriptionPanel, and sprites for Logistics (Mobster), Influence (Schemer), Authority (Subterfuge).
Flow
- Start()
selectedTrait.Changed.Register(UpdateUI)andLocalizationManager.OnLocalizeEvent += Localize.- Seed selection from
startingSelectedTrait.TraitData.
- UpdateUI(ChairmanTrait t)
- Set raw
titleText,descText, andtraitIcon.spritefromt. - Choose frame by
t.costType:AFFINITY_MOBSTER→ Logistics frameAFFINITY_SCHEMER→ Influence frameAFFINITY_SUBTERFUGE→ Authority frame
- Call
Localize()to swap to localized strings.
- Set raw
- Localize()
- Uses
t.GetLocalizedTitle()andt.GetLocalizedDesc().
- Uses
- OnDestroy() — unregisters both handlers.