Finish GameObject Inspector, some UI cleanups

This commit is contained in:
Sinai
2021-05-16 21:46:19 +10:00
parent f4e473f8e6
commit ca65affb5c
12 changed files with 1112 additions and 184 deletions

View File

@ -33,21 +33,23 @@ namespace UnityExplorer.UI.Inspectors
public GameObject CreateContent(GameObject parent)
{
UIRoot = UIFactory.CreateHorizontalGroup(parent, "TabObject", true, true, true, true, 0,
new Vector4(0, 0, 3, 0), new Color(0.13f, 0.13f, 0.13f));
UIFactory.SetLayoutElement(UIRoot, minWidth: 185, flexibleWidth: 0);
UIRoot = UIFactory.CreateHorizontalGroup(parent, "TabObject", false, true, true, true, 0,
default, new Color(0.13f, 0.13f, 0.13f), childAlignment: TextAnchor.MiddleLeft);
UIFactory.SetLayoutElement(UIRoot, minWidth: 200, flexibleWidth: 0);
UIRoot.AddComponent<Mask>();
TabButton = UIFactory.CreateButton(UIRoot, "TabButton", "");
UIFactory.SetLayoutElement(TabButton.Component.gameObject, minWidth: 165, flexibleWidth: 0);
UIFactory.SetLayoutElement(TabButton.Component.gameObject, minWidth: 175, flexibleWidth: 0);
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(TabButton.Component.gameObject, false, false, true, true, 0, 0, 0, 3);
TabText = TabButton.Component.GetComponentInChildren<Text>();
TabText.horizontalOverflow = HorizontalWrapMode.Overflow;
UIFactory.SetLayoutElement(TabText.gameObject, minHeight: 25, minWidth: 175, flexibleWidth: 0);
TabText.alignment = TextAnchor.MiddleLeft;
TabText.fontSize = 12;
TabText.horizontalOverflow = HorizontalWrapMode.Overflow;
CloseButton = UIFactory.CreateButton(UIRoot, "CloseButton", "X", new Color(0.2f, 0.2f, 0.2f, 1));
UIFactory.SetLayoutElement(CloseButton.Component.gameObject, minWidth: 20, flexibleWidth: 0);
UIFactory.SetLayoutElement(CloseButton.Component.gameObject, minHeight: 25, minWidth: 25, flexibleWidth: 0);
var closeBtnText = CloseButton.Component.GetComponentInChildren<Text>();
closeBtnText.color = Color.red;