优化步骤列表UI

This commit is contained in:
shenjianxing 2025-02-07 13:35:33 +08:00
parent e73daba55f
commit fe5169e55a
2 changed files with 10 additions and 7 deletions

View File

@ -465,8 +465,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 131.91986, y: 0} m_AnchoredPosition: {x: 216.55383, y: 0}
m_SizeDelta: {x: 263.8398, y: -752.1277} m_SizeDelta: {x: 433.1077, y: -752.1277}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9008854919363526693 --- !u!222 &9008854919363526693
CanvasRenderer: CanvasRenderer:
@ -725,7 +725,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1 m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:
@ -1274,7 +1274,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1 m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:

View File

@ -20,7 +20,7 @@ namespace QFramework.Example
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
mData = uiData as UIOperationListData ?? new UIOperationListData(); mData = uiData as UIOperationListData ?? new UIOperationListData();
TypeEventSystem.Global.Register<OnModuleQuit>((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
} }
private void OnStepChanged(StepStatusOnChange change) private void OnStepChanged(StepStatusOnChange change)
@ -100,14 +100,17 @@ namespace QFramework.Example
subContent.gameObject.SetActive(false); subContent.gameObject.SetActive(false);
btn.name = btns.Count.ToString(); btn.name = btns.Count.ToString();
btns.Add(btn); btns.Add(btn);
arrow.gameObject.SetActive(subContent.transform.childCount > 0);
btn.onClick.AddListener(() => btn.onClick.AddListener(() =>
{
if (subContent.transform.childCount > 0)
{ {
subContent.SetActive(!subContent.activeSelf); subContent.SetActive(!subContent.activeSelf);
}
if (op.freeStep) if (op.freeStep)
{ {
if (highIcon.color != highColor) if (highIcon.color != highColor)
{ {
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) }); TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) });
} }
} }