PlayInEditor.generated.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. using System.Runtime.InteropServices;
  6. using bs;
  7. namespace bs.Editor
  8. {
  9. /** @addtogroup Editor-General
  10. * @{
  11. */
  12. /// <summary>Handles functionality specific to running the game in editor.</summary>
  13. [ShowInInspector]
  14. public partial class PlayInEditor : ScriptObject
  15. {
  16. private PlayInEditor(bool __dummy0) { }
  17. protected PlayInEditor() { }
  18. /// <summary>Triggered right after the play mode is entered.</summary>
  19. public static event Action OnPlay;
  20. /// <summary>Triggered right after the play mode is exited.</summary>
  21. static partial void Callback_OnStopped();
  22. /// <summary>Triggered right after the user pauses play mode.</summary>
  23. public static event Action OnPaused;
  24. /// <summary>Triggered right after the user unpauses play mode.</summary>
  25. public static event Action OnUnpaused;
  26. /// <summary>Runs the game for a single frame and then pauses it.</summary>
  27. public static void FrameStep()
  28. {
  29. Internal_frameStep();
  30. }
  31. [MethodImpl(MethodImplOptions.InternalCall)]
  32. private static extern PlayInEditorState Internal_getState();
  33. [MethodImpl(MethodImplOptions.InternalCall)]
  34. private static extern void Internal_setState(PlayInEditorState state);
  35. [MethodImpl(MethodImplOptions.InternalCall)]
  36. private static extern void Internal_frameStep();
  37. private static void Internal_onPlay()
  38. {
  39. OnPlay?.Invoke();
  40. }
  41. private static void Internal_onStopped()
  42. {
  43. Callback_OnStopped();
  44. }
  45. private static void Internal_onPaused()
  46. {
  47. OnPaused?.Invoke();
  48. }
  49. private static void Internal_onUnpaused()
  50. {
  51. OnUnpaused?.Invoke();
  52. }
  53. }
  54. /** @} */
  55. }