Example #1
0
    void updateStats()
    {
        mapNameText.text = StageInfo.mapName();

        float statsMapLocal   = StageInfo.statsMapLocal(player);
        float statsMapGlobal  = StageInfo.statsMapGlobal(player);
        float statsItemLocal  = StageInfo.statsItemLocal(player);
        float statsItemGlobal = StageInfo.statsItemGlobal(player);

        statsMapL.text  = (statsMapLocal >= 0) ? statsMapLocal + "%" : "- %";
        statsMapG.text  = (statsMapGlobal >= 0) ? statsMapGlobal + "%" : "- %";
        statsItemL.text = (statsItemLocal >= 0) ? statsItemLocal + "%" : "- %";
        statsItemG.text = (statsItemGlobal >= 0) ? statsItemGlobal + "%" : "- %";

        decideTextColor(statsMapL);
        decideTextColor(statsMapG);
        decideTextColor(statsItemL);
        decideTextColor(statsItemG);
    }