diff --git a/Assets/Art/UIPrefab/UIOperationList.prefab b/Assets/Art/UIPrefab/UIOperationList.prefab index e387fe22..1f4d179f 100644 --- a/Assets/Art/UIPrefab/UIOperationList.prefab +++ b/Assets/Art/UIPrefab/UIOperationList.prefab @@ -465,8 +465,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 131.91986, y: 0} - m_SizeDelta: {x: 263.8398, y: -752.1277} + m_AnchoredPosition: {x: 216.55383, y: 0} + m_SizeDelta: {x: 433.1077, y: -752.1277} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &9008854919363526693 CanvasRenderer: @@ -725,7 +725,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 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_Maskable: 1 m_OnCullStateChanged: @@ -1274,7 +1274,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} 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_Maskable: 1 m_OnCullStateChanged: diff --git a/Assets/Scripts/UI/UIOperationList.cs b/Assets/Scripts/UI/UIOperationList.cs index 82693fb9..e767697a 100644 --- a/Assets/Scripts/UI/UIOperationList.cs +++ b/Assets/Scripts/UI/UIOperationList.cs @@ -20,7 +20,7 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIOperationListData ?? new UIOperationListData(); - TypeEventSystem.Global.Register((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) @@ -100,14 +100,17 @@ namespace QFramework.Example subContent.gameObject.SetActive(false); btn.name = btns.Count.ToString(); btns.Add(btn); + arrow.gameObject.SetActive(subContent.transform.childCount > 0); btn.onClick.AddListener(() => { - subContent.SetActive(!subContent.activeSelf); + if (subContent.transform.childCount > 0) + { + subContent.SetActive(!subContent.activeSelf); + } if (op.freeStep) { if (highIcon.color != highColor) { - TypeEventSystem.Global.Send(new StepExecute() { index = int.Parse(btn.name) }); } }