养成基本完毕,新UI,修bug,装备初步,

This commit is contained in:
FloatGaming
2026-03-23 22:37:14 +08:00
parent 49e45ac464
commit dd205b6cb4
2349 changed files with 261722 additions and 283 deletions
@@ -94,13 +94,13 @@ namespace EasyChart
var state = label.userData as AppliedState;
int themeId = theme != null ? theme.GetInstanceID() : 0;
UnityEngine.Object fontObj = theme != null ? theme.primaryFont : null;
UnityEngine.Object fontObj = ResolveRoleFontObject(theme, role);
int fontId = fontObj != null ? fontObj.GetInstanceID() : 0;
float scale = theme != null ? theme.fontScale : 1f;
float roleSizeOverride = ResolveRoleFontSizeOverride(theme, role);
float appliedRoleSizeOverride = roleSizeOverride;
if (roleSizeOverride >= 0f && HasInlineFontSize(label))
if (role != ChartTextRole.Tooltip && roleSizeOverride >= 0f && HasInlineFontSize(label))
{
appliedRoleSizeOverride = -1f;
}
@@ -225,6 +225,18 @@ namespace EasyChart
}
}
private static UnityEngine.Object ResolveRoleFontObject(ChartTheme theme, ChartTextRole role)
{
if (theme == null) return null;
if (role == ChartTextRole.Tooltip && theme.tooltipFont != null)
{
return theme.tooltipFont;
}
return theme.primaryFont;
}
private static void ApplyFont(Label label, UnityEngine.Object fontObj)
{
if (label == null) return;