AlertSystem.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 AlertSystem
  14. {
  15. private static AlertWindow _alertWindow;
  16. public static IAlert Show(string message)
  17. {
  18. if (_alertWindow == null)
  19. {
  20. _alertWindow = new AlertWindow();
  21. }
  22. _alertWindow.Reset();
  23. _alertWindow.viewName = "AlertSystem";
  24. _alertWindow.SetLayer(ConstViewLayer.ALERT);
  25. _alertWindow.SetMessage(message);
  26. _alertWindow.Show();
  27. return _alertWindow;
  28. }
  29. public static void hide()
  30. {
  31. if (_alertWindow != null)
  32. {
  33. _alertWindow.Hide();
  34. }
  35. }
  36. public static void Dispose()
  37. {
  38. _alertWindow = null;
  39. }
  40. }
  41. }