예제 #1
0
 public static void ShowAlert(string content, bool showConfirm = true, bool showCancel = false, bool showClose = false, Action confirm = null, Action cancel = null, string confirmText = "", string cancelText = "")
 {
     ShowImmediatelyAsync("window_alert", null, window =>
     {
         Window_Alert alert = window as Window_Alert;
         if (alert == null)
         {
             //打开错误的时候关闭界面
             if (window != null)
             {
                 window.gameObject.SetActive(false);
             }
             return;
         }
         if (showCancel && cancel == null)
         {
             cancel = () => { }
         }
         ;
         alert.content.text = content.Replace("\\n", "\n");//Util.Format(@"{0}", content);
         alert.SetButtonVisible(showConfirm, showCancel, showClose);
         alert.SetButtonCallback(confirm, cancel);
         alert.ChangeButtonText(confirmText, cancelText);
     });
 }