From 92ebf0bcc97d00b72ace28a14788606c3d86808c Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 9 Jan 2025 10:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A1=86=E6=9E=B6=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=80=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Art/UIPrefab/UIModuleSelect.prefab | 4 ++-- Assets/Scripts/Controller/OperationController.cs | 11 +++++++++-- Assets/Scripts/UI/UIOperationList.cs | 9 +++------ Assets/Scripts/UI/UIRightTop.cs | 6 +++--- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Assets/Art/UIPrefab/UIModuleSelect.prefab b/Assets/Art/UIPrefab/UIModuleSelect.prefab index 33238870..e300a7d2 100644 --- a/Assets/Art/UIPrefab/UIModuleSelect.prefab +++ b/Assets/Art/UIPrefab/UIModuleSelect.prefab @@ -403,7 +403,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -30, y: -30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7870331819941572208 CanvasRenderer: @@ -433,7 +433,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\u6A21\u5757\u540D\u79F0" + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 9bbfb1bdb0251664eb0932e39724900e, type: 2} m_sharedMaterial: {fileID: 5103963756306747964, guid: 9bbfb1bdb0251664eb0932e39724900e, type: 2} diff --git a/Assets/Scripts/Controller/OperationController.cs b/Assets/Scripts/Controller/OperationController.cs index cbeb9eab..156f24ad 100644 --- a/Assets/Scripts/Controller/OperationController.cs +++ b/Assets/Scripts/Controller/OperationController.cs @@ -46,6 +46,7 @@ public class OperationController : MonoSingleton { Refresh(); }).UnRegisterWhenGameObjectDestroyed(gameObject); + } public void Refresh() @@ -66,18 +67,24 @@ public class OperationController : MonoSingleton } TypeEventSystem.Global.Register(OnExecute); TypeEventSystem.Global.Register(OnNext); - TypeEventSystem.Global.Register(arg => Clear()); + TypeEventSystem.Global.Register(OnModuleQuitHandler); } } } + private void OnModuleQuitHandler(OnModuleQuit quit) + { + Clear(); + } + public void Clear() { + index = -1; curAction.Deinit(); steps.Clear(); - TypeEventSystem.Global.UnRegister(arg => Clear()); + TypeEventSystem.Global.UnRegister(OnModuleQuitHandler); TypeEventSystem.Global.UnRegister(OnExecute); TypeEventSystem.Global.UnRegister(OnNext); diff --git a/Assets/Scripts/UI/UIOperationList.cs b/Assets/Scripts/UI/UIOperationList.cs index 58c14ec6..12ab9209 100644 --- a/Assets/Scripts/UI/UIOperationList.cs +++ b/Assets/Scripts/UI/UIOperationList.cs @@ -20,7 +20,6 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIOperationListData ?? new UIOperationListData(); - TypeEventSystem.Global.Register(OnStepChanged); TypeEventSystem.Global.Register((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } @@ -83,6 +82,8 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { + TypeEventSystem.Global.Register(OnStepChanged).UnRegisterWhenDisabled(this); + btns.Clear(); op = OperationController.Instance.operation; StepContent.RemoveAllChildren(); foreach (var item in op.Steps) @@ -139,13 +140,9 @@ namespace QFramework.Example protected override void OnShow() { } - - protected override void OnHide() - { - } - protected override void OnClose() { + TypeEventSystem.Global.UnRegister(OnStepChanged); } } } diff --git a/Assets/Scripts/UI/UIRightTop.cs b/Assets/Scripts/UI/UIRightTop.cs index 6a2e3cc3..af5b0951 100644 --- a/Assets/Scripts/UI/UIRightTop.cs +++ b/Assets/Scripts/UI/UIRightTop.cs @@ -25,7 +25,7 @@ namespace QFramework.Example data.btns.Add(new UITipWindowData.ItemData() { txt = "" }); UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); }); - closeBtn.onClick.AddListener(Home); + backBtn.onClick.AddListener(Home); homeBtn.onClick.AddListener(Home); desBtn.onClick.AddListener(() => @@ -45,7 +45,7 @@ namespace QFramework.Example data.txt = "Ƿ˳ǰģ飿"; data.btns.Add(new UITipWindowData.ItemData() { - txt = "ȷ", + txt = "", OnClick = () => { Hide(); @@ -53,7 +53,7 @@ namespace QFramework.Example UIKit.OpenPanelAsync().ToAction().StartGlobal(); } }); - data.btns.Add(new UITipWindowData.ItemData() { txt = "ȡ" }); + data.btns.Add(new UITipWindowData.ItemData() { txt = "" }); UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); }