GamePlayEvents.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine.Core
  5. {
  6. public enum GameOverCause
  7. {
  8. Death,
  9. Abandon,
  10. Victory
  11. }
  12. public class GamePlayEvents
  13. {
  14. public static event System.Action OnGameStart;
  15. public static event System.Action<GameOverCause> OnGameOver;
  16. public static event System.Action OnGamePaused;
  17. public static event System.Action OnGameUnpaused;
  18. public static void GameStart()
  19. {
  20. if(OnGameStart != null)
  21. {
  22. OnGameStart();
  23. }
  24. }
  25. public static void GameOver(GameOverCause cause)
  26. {
  27. if(OnGameOver != null)
  28. {
  29. OnGameOver(cause);
  30. }
  31. }
  32. public static void GamePaused()
  33. {
  34. if(OnGamePaused != null)
  35. {
  36. OnGamePaused();
  37. }
  38. }
  39. public static void GameUnpaused()
  40. {
  41. if(OnGameUnpaused != null)
  42. {
  43. OnGameUnpaused();
  44. }
  45. }
  46. }
  47. }