DailyMoneyCounter
Overview
Displays +N $/day (localized with I2) based on a daily gain variable. Supports prediction coloring, and hides while the Event panel is open using a DOTweenAnimation.
Serialized
- FloatVariable
dailyGain,currentMoney - DOTweenAnimation
displayTween - ChairmanEventEvent
openEventPanel - VoidEvent
eventPanelClosed - Prediction: FloatEvent
moneyPrediction, ColorpredictedPositiveColor,predictedNegativeColor
Behavior
- Start()
- Cache TMP, register
dailyGain.Changed → UpdateText,moneyPrediction → UpdateTextPrediction. - Register
openEventPanel → HidePanel,eventPanelClosed → ShowPanel. - Initialize text; subscribe to
LocalizationManager.OnLocalizeEventand refresh on language change.
- Cache TMP, register
- UpdateText(value) → shows
+N $/{MONEY_GAIN_DAY}usingInvariantCulture; sets pale gold for ≥0 or red for <0. - UpdateTextPrediction(change) → shows
±N$with prediction colors, and forces ShowPanel(). - ShowPanel/HidePanel() → play the tween backward/forward and toggle a
hiddenflag. - OnDestroy() → unregister and remove localization handler.