MenuEvents.cs 992 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine
  5. {
  6. public class MenuEvents
  7. {
  8. public static event System.Action<string, bool> OnOpenPanel;
  9. public static event System.Action<string> OnClosePanel;
  10. public static event System.Action<string, string> OnExecuteMenuItem;
  11. public static void OpenPanel(string panelName, bool closePrevious)
  12. {
  13. if(OnOpenPanel != null)
  14. {
  15. OnOpenPanel(panelName, closePrevious);
  16. }
  17. }
  18. public static void ClosePanel(string panelName)
  19. {
  20. if(OnClosePanel != null)
  21. {
  22. OnClosePanel(panelName);
  23. }
  24. }
  25. public static void ExecuteMenuItem(string panelName, string menuItemName)
  26. {
  27. if(OnExecuteMenuItem != null)
  28. {
  29. OnExecuteMenuItem(panelName, menuItemName);
  30. }
  31. }
  32. }
  33. }