TransitionEvents.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine.Core
  5. {
  6. public class TransitionEvents
  7. {
  8. public static event System.Action<float> OnFadeIn;
  9. public static event System.Action<float> OnFadeOut;
  10. public static event System.Action<SceneChangeData, float> OnChangeScene;
  11. public static event System.Action OnTransitionFinish;
  12. public static event System.Action<string> OnSceneStart;
  13. public static event System.Action OnGetLocationName;
  14. public static event System.Action<string> OnLocationName;
  15. public static void FadeIn(float time)
  16. {
  17. if(OnFadeIn != null)
  18. {
  19. OnFadeIn(time);
  20. }
  21. }
  22. public static void FadeOut(float time)
  23. {
  24. if(OnFadeOut != null)
  25. {
  26. OnFadeOut(time);
  27. }
  28. }
  29. public static void ChangeScene(SceneChangeData sceneChangeData, float time)
  30. {
  31. if(OnChangeScene != null)
  32. {
  33. OnChangeScene(sceneChangeData, time);
  34. }
  35. }
  36. public static void TransitionFinish()
  37. {
  38. if(OnTransitionFinish != null)
  39. {
  40. OnTransitionFinish();
  41. }
  42. }
  43. public static void SceneStart(string link)
  44. {
  45. if(OnSceneStart != null)
  46. {
  47. OnSceneStart(link);
  48. }
  49. }
  50. public static void GetLocationName()
  51. {
  52. if(OnGetLocationName != null)
  53. {
  54. OnGetLocationName();
  55. }
  56. }
  57. public static void SendLocationName(string locationName)
  58. {
  59. if(OnLocationName != null)
  60. {
  61. OnLocationName(locationName);
  62. }
  63. }
  64. }
  65. }