示例#1
0
 public void DisplayError(string title, string description, string button = "", System.Action action = null)
 {
     UnityEngine.Debug.Log("Display error " + title);
     UINotifications.Notification error_message = new UINotifications.Notification(title, description);
     if (button != "" && action != null)
     {
         error_message.AddButton(button, new UINotifications.ButtonMethod(() => { action(); }));
     }
     error_message.AddButton("Close", new UINotifications.ButtonMethod(() => { UINotifications.Close(); }));
     error_message.AddButton("Exit", new UINotifications.ButtonMethod(() => { Application.Quit(); }));
     UINotifications.Notify(error_message);
 }
示例#2
0
 void DisplayError(string title, string description, string buttonA = "", Action actionA = null, string buttonB = "", Action actionB = null)
 {
     UnityEngine.Debug.Log("Display error " + title);
     UINotifications.Notification error_message = new UINotifications.Notification(title, description);
     if (buttonA != "" && actionA != null)
     {
         error_message.AddButton(buttonA, new UINotifications.ButtonMethod(() => { actionA(); }));
     }
     if (buttonB != "" && actionB != null)
     {
         error_message.AddButton(buttonB, new UINotifications.ButtonMethod(() => { actionB(); }));
     }
     error_message.AddButton("Exit", new UINotifications.ButtonMethod(() => { Application.Quit(); }));
     UINotifications.Notify(error_message);
 }