/// <summary> /// 隐藏GrayScreen, /// </summary> /// <param name="wnd"></param> public static void HideGrayScreen(UI3Wnd wnd) { if (wnd == null || wnd.gameObject == null || wnd.WndType != UI3WndType.PopUp || wnd.GetClassName() == "UIGrayScreen") { return; } UIGrayScreen grayWnd = findWindow <UIGrayScreen>(); if (grayWnd == null) { return; } string panelLayer = GetPanelLayer(wnd.GetClassName()); UIStack <string> stack = GetStackByPanelLayer(panelLayer); if (stack == null) { return; } UI3Wnd lastWnd = GetLastGrayScreen(stack); if (lastWnd == null) { grayWnd.setActive(false); } else { ShowGrayScreen(lastWnd); } }
public static GameObject getWndRootPanel(GameObject go) { if (go == null) { return(null); } UI3Wnd wnd = go.GetComponent <UI3Wnd>(); if (wnd == null) { return(null); } string wndName = wnd.GetClassName();; return(getWndRootPanel(wndName)); }
/// <summary> /// 显示GrayScreen, /// </summary> /// <param name="wnd"></param> /// <param name="OnClickGrayScreen"></param> public static void ShowGrayScreen(UI3Wnd wnd, System.Action OnClickGrayScreen = null) { if (wnd == null || wnd.gameObject == null || wnd.WndType != UI3WndType.PopUp || wnd.GetClassName() == "UIGrayScreen") { return; } UIGrayScreen grayWnd = createWindow <UIGrayScreen>(); if (grayWnd == null) { return; } grayWnd.OnClickEventCallback = OnClickGrayScreen != null ? OnClickGrayScreen : wnd.OnClickGrayScreen; grayWnd.Wnd = wnd.gameObject; int depth = wnd.getMinDepth(); grayWnd.setDepth(depth - 1); grayWnd.setActive(true); }