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(); }