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, Color predictedPositiveColor, predictedNegativeColor

Behavior

  • Start()
    • Cache TMP, register dailyGain.Changed → UpdateText, moneyPrediction → UpdateTextPrediction.
    • Register openEventPanel → HidePanel, eventPanelClosed → ShowPanel.
    • Initialize text; subscribe to LocalizationManager.OnLocalizeEvent and refresh on language change.
  • UpdateText(value) → shows +N $/{MONEY_GAIN_DAY} using InvariantCulture; 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 hidden flag.
  • OnDestroy() → unregister and remove localization handler.