【UI】修改UI显示的堆栈管理
parent
cfec6934ba
commit
f7499f75cd
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
|
|
@ -41,7 +42,7 @@
|
|||
_uiWindowStack.Clear();
|
||||
}
|
||||
|
||||
public static async UniTask<UIWindow> AnimSwitchWindow(UIWindow hideWindow, UIWindowCloseType closeType, string showWindowName, object data)
|
||||
public static async UniTask<UIWindow> AnimSwitchWindow(UIWindow hideWindow, UIWindowCloseType closeType, string showWindowName, object data = null)
|
||||
{
|
||||
if (hideWindow != null)
|
||||
{
|
||||
|
|
@ -74,4 +75,27 @@
|
|||
|
||||
return showWindow;
|
||||
}
|
||||
|
||||
//常规的关闭一个最后打开的界面
|
||||
public static async UniTask NormalCloseWindow(UIWindow hideWindow, String showWindowStr, Object data = null)
|
||||
{
|
||||
var window = Instance.PopWindow();
|
||||
if (!window)
|
||||
{
|
||||
hideWindow.OnBack();
|
||||
return;
|
||||
}
|
||||
await AnimSwitchWindow(hideWindow, UIWindowCloseType.OnlyHide, showWindowStr, data);
|
||||
}
|
||||
|
||||
public static async UniTask NormalCloseWindow(UIWindow hideWindow, Object data = null)
|
||||
{
|
||||
var showWindow = Instance.PopWindow();
|
||||
if (!showWindow)
|
||||
{
|
||||
hideWindow.OnBack();
|
||||
return;
|
||||
}
|
||||
await AnimSwitchWindow(hideWindow, UIWindowCloseType.OnlyHide, showWindow, data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public partial class UIManager
|
|||
_WindowMeta(UINameConst.UIStoryMain, UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UINewLogin, UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UIGiftCode, UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UI_MainPanel, UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UI_MainPanel, UIWindowLayer.BackGround);
|
||||
_WindowMeta(UINameConst.UI_LevelSelect,UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UI_BeforeFight,UIWindowLayer.Normal);
|
||||
_WindowMeta(UINameConst.UI_Setting,UIWindowLayer.Normal);
|
||||
|
|
|
|||
|
|
@ -387,11 +387,7 @@ public partial class UIManager : Singlenton<UIManager>, IInitable
|
|||
while (node != null)
|
||||
{
|
||||
var window = node.Value;
|
||||
|
||||
if (window.WindowName != path)
|
||||
{
|
||||
toBeRemoved.Add(window);
|
||||
}
|
||||
toBeRemoved.Add(window);
|
||||
|
||||
if (node == windowsL.Last)
|
||||
{
|
||||
|
|
@ -402,6 +398,7 @@ public partial class UIManager : Singlenton<UIManager>, IInitable
|
|||
}
|
||||
}
|
||||
|
||||
ClearHideStack();
|
||||
for (int i = toBeRemoved.Count - 1; i >= 0; i--)
|
||||
{
|
||||
CloseWindow(toBeRemoved[i].WindowName, UIWindowCloseType.HideAndDestroy);
|
||||
|
|
|
|||
|
|
@ -723,7 +723,8 @@ public class UISelectCharacterController : UIWindow
|
|||
CultivateStruct cultivateStruct = new CultivateStruct();
|
||||
cultivateStruct.showList = mShowList;
|
||||
cultivateStruct.info = info;
|
||||
await UIManager.Instance.OpenWindow(UINameConst.UI_Cultivate, cultivateStruct);
|
||||
await UIManager.AnimSwitchWindow(this, UIWindowCloseType.HideAndPush, UINameConst.UI_Cultivate);
|
||||
//await UIManager.Instance.OpenWindow(UINameConst.UI_Cultivate, cultivateStruct);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -340,11 +340,12 @@ public class UI_CultivateController : UIWindow
|
|||
//{
|
||||
// return fingerUpPosition.x - fingerDownPosition.x > 50f; // 调整阈值以适应您的需求
|
||||
//}
|
||||
private void OnButton_BackClick()
|
||||
private async void OnButton_BackClick()
|
||||
{
|
||||
CloseCurOpenChildUI();
|
||||
|
||||
UIManager.Instance.CloseWindow(UINameConst.UI_Cultivate);
|
||||
//UIManager.Instance.CloseWindow(UINameConst.UI_Cultivate);
|
||||
await UIManager.NormalCloseWindow(this);
|
||||
}
|
||||
|
||||
private void OnClickHome()
|
||||
|
|
|
|||
Loading…
Reference in New Issue