AlertUI.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * 使用示例:
  3. AlertSystem.Show("喜欢吗!")
  4. .SetTitle("温馨提示")
  5. .SetLeftButton(true, "喜欢", (object data1) =>
  6. {
  7. })
  8. .SetRightButton(true, "不喜欢")
  9. .SetData("aa");
  10. */
  11. namespace GFGGame
  12. {
  13. public class AlertUI
  14. {
  15. private static AlertWindow _alertWindow;
  16. public static IAlert Show(string message, string tips = "")
  17. {
  18. if (_alertWindow == null)
  19. {
  20. _alertWindow = new AlertWindow();
  21. }
  22. _alertWindow.Reset();
  23. _alertWindow.viewName = "AlertUI";
  24. _alertWindow.SetLayer(ConstViewLayer.TOP);
  25. _alertWindow.SetMessage(message);
  26. _alertWindow.SetTips(tips);
  27. _alertWindow.Show();
  28. return _alertWindow;
  29. }
  30. public static void hide()
  31. {
  32. if (_alertWindow != null)
  33. {
  34. _alertWindow.Hide();
  35. }
  36. }
  37. public static void Dispose()
  38. {
  39. _alertWindow = null;
  40. }
  41. }
  42. }