mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-15 15:57:52 +08:00
Finish GameObject Inspector, some UI cleanups
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user