This commit is contained in:
2026-06-07 11:49:55 +08:00
parent ff0f3bde54
commit 1897658a00
98 changed files with 9903 additions and 13907 deletions

View File

@@ -359,6 +359,7 @@ namespace BaseGames.Editor.UI
private static GameObject BuildSettingHeader(List<string> report)
{
var go = NewUI(PfSettingHeader, 480, 32);
var hdrLe = go.AddComponent<LayoutElement>(); hdrLe.preferredHeight = 36f; hdrLe.minHeight = 32f;
var lblGo = NewUIChild(go.transform, "Label", out var rt);
Stretch(rt);
var lbl = lblGo.AddComponent<TextMeshProUGUI>();
@@ -414,6 +415,7 @@ namespace BaseGames.Editor.UI
private static GameObject SettingRowRoot(string name, out TMP_Text label)
{
var go = NewUI(name, 480, 44);
var rowLe = go.AddComponent<LayoutElement>(); rowLe.preferredHeight = 44f; rowLe.minHeight = 40f;
var h = go.AddComponent<HorizontalLayoutGroup>();
h.spacing = 12; h.childAlignment = TextAnchor.MiddleLeft;
h.childForceExpandWidth = false; h.childForceExpandHeight = false;
@@ -539,6 +541,10 @@ namespace BaseGames.Editor.UI
if (s_theme != null) AssignRef(uiBtn, "_theme", s_theme);
var view = go.AddComponent<MainMenuButtonView>();
// LayoutElement放入竖排布局VerticalLayoutGroup childControlHeight时保持固定行高避免被压扁
var le = go.AddComponent<LayoutElement>();
le.preferredHeight = 64f; le.minHeight = 56f;
var iconGo = NewUIChild(go.transform, "Icon", out var irt);
irt.anchorMin = new Vector2(0, 0.5f); irt.anchorMax = new Vector2(0, 0.5f); irt.pivot = new Vector2(0, 0.5f);
irt.anchoredPosition = new Vector2(14, 0); irt.sizeDelta = new Vector2(32, 32);