private void doClose(UIWin win, object message = null) { if (win) { openWins.Remove(win); win.gameObject.SetActive(false); win.Close(message); if (winAction != null) { if (openWins.Last != null) { UIWin lastWin = openWins.Last.Value; if (lastWin.backdrop) { winAction(lastWin.transform); } else { winAction(null); } } else { winAction(null); } } } }
private void DestroyUINode(WinID ID) { UIWin win = UIInstances[(int)ID]; if (win) { if (openWins.Contains(win)) { openWins.Remove(win); win.Close(null); if (winAction != null) { if (openWins.Last != null) { UIWin lastWin = openWins.Last.Value; if (lastWin.backdrop) { winAction(lastWin.transform); } else { winAction(null); } } else { winAction(null); } } } NGUITools.Destroy(win.gameObject); UIInstances[(int)ID] = null; } }
private void doClose(UIWin win, object message = null) { if (win) { win.gameObject.SetActive(false); win.Close(message); } }
public void CloseWin(string winName, bool destroy = true) { if (winDic.ContainsKey(winName)) { UIWin win = winDic [winName]; winDic.Remove(winName); win.Close(destroy); } else { Log.e("UIManager", "CloseWin", "尝试关闭不存在的win name:" + winName, BeShowLog); } }
/// <summary> /// 关闭window /// </summary> /// <param name="winName"></param> /// <param name="cb"></param> public void CloseWindow(string winName) { if (string.IsNullOrEmpty(winName)) { Debug.Log("window name is null"); return; } GameObject go = FindWindow(winName); if (go != null) { UIWin win = go.GetComponent <UIWin>(); if (win != null) { win.Close(); } } }
public void CloseCurWin(bool destroy = true) { if (null != CurWin) { if (destroy) { if (winDic.ContainsKey(CurWin.Name)) { winDic.Remove(CurWin.Name); } else { Log.e("UIManager", "CloseCurWin", "关闭当前窗口时发现" + CurWin.Name + "不存在", BeShowLog); } } CurWin.Close(destroy); } else { Log.i("UIManager", "CloseCurWin", "CurWin=null", BeShowLog); } }