Esempio n. 1
0
 /// <summary>
 /// close the win.
 /// </summary>
 /// <param name="win"></param>
 /// <param name="message">the param pass back in OnClose</param>
 /// <param name="doRefresh">if need refresh the other normal win. only used for normal window</param>
 /// <returns></returns>
 public void CloseWindow(UIWin win, object message = null, bool doRefresh = true)
 {
     try
     {
         if (win && IsOpen(win.ID))
         {
             //这里需要先关闭窗口(CloseNormalWin),因为在win Close里面很可能调用CLOSEALL, CLOSEALL又会调用到该win的CloseWindow,造成死循环
             if (win.closeAnim)
             {
                 win.PlayCloseAnim(() =>
                 {
                     doClose(win, message);
                     if (win.eLayer == EUILayer.Normal)
                     {
                         CloseNormalWin(win, doRefresh);
                     }
                     CheckBack();
                 });
             }
             else
             {
                 doClose(win, message);
                 if (win.eLayer == EUILayer.Normal)
                 {
                     CloseNormalWin(win, doRefresh);
                 }
                 CheckBack();
             }
         }
     }
     catch (System.Exception ex)
     {
         Debug.LogException(ex);
     }
 }
Esempio n. 2
0
 public void DoCloseWindow(UIWin win, object message = null, bool doRefresh = true)
 {
     try {
         if (win && IsOpen(win.ID))
         {
             if (win.closeAnim)
             {
                 win.PlayCloseAnim(() => {
                     closeWin(win, message, doRefresh);
                 });
             }
             else
             {
                 closeWin(win, message, doRefresh);
             }
         }
     } catch (System.Exception ex) {
         Debug.LogException(ex);
     }
 }