ui基本完毕,修了一大把的bug
This commit is contained in:
@@ -23,6 +23,8 @@ public class UI_Idols : MonoBehaviour
|
||||
|
||||
[Header("colors")]
|
||||
public Color[] idolSliderColors;
|
||||
public Color statIncreaseColor = new Color32(0x7C, 0xFF, 0x6B, 0xFF);
|
||||
public Color statDecreaseColor = new Color32(0xFF, 0x5A, 0x5A, 0xFF);
|
||||
|
||||
[Header("paths")]
|
||||
public string idolSOpath_runtime;
|
||||
@@ -986,7 +988,7 @@ public class UI_Idols : MonoBehaviour
|
||||
return Mathf.RoundToInt(value * 100f) + "%";
|
||||
}
|
||||
|
||||
private static string FormatGrowthInt(int baseValue, int effectiveValue)
|
||||
private string FormatGrowthInt(int baseValue, int effectiveValue)
|
||||
{
|
||||
int growth = effectiveValue - baseValue;
|
||||
if (growth == 0)
|
||||
@@ -995,11 +997,11 @@ public class UI_Idols : MonoBehaviour
|
||||
}
|
||||
|
||||
string sign = growth > 0 ? "+" : "-";
|
||||
string color = growth > 0 ? "#7CFF6B" : "#FF5A5A";
|
||||
string color = "#" + ColorUtility.ToHtmlStringRGB(growth > 0 ? statIncreaseColor : statDecreaseColor);
|
||||
return $"{baseValue} <color={color}>{sign} {Mathf.Abs(growth)}</color>";
|
||||
}
|
||||
|
||||
private static string FormatGrowthPercent(float baseValue, float effectiveValue)
|
||||
private string FormatGrowthPercent(float baseValue, float effectiveValue)
|
||||
{
|
||||
float growth = effectiveValue - baseValue;
|
||||
string baseText = FormatPercent(baseValue);
|
||||
@@ -1009,7 +1011,7 @@ public class UI_Idols : MonoBehaviour
|
||||
}
|
||||
|
||||
string sign = growth > 0f ? "+" : "-";
|
||||
string color = growth > 0f ? "#7CFF6B" : "#FF5A5A";
|
||||
string color = "#" + ColorUtility.ToHtmlStringRGB(growth > 0f ? statIncreaseColor : statDecreaseColor);
|
||||
return $"{baseText} <color={color}>{sign} {FormatPercent(Mathf.Abs(growth))}</color>";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user