BsEditorScriptManager.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsModule.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Handles all editor script modules, updates editor windows and similar.
  8. */
  9. class BS_SCR_BED_EXPORT EditorScriptManager : public Module<EditorScriptManager>
  10. {
  11. public:
  12. EditorScriptManager();
  13. ~EditorScriptManager();
  14. /**
  15. * @brief Called every frame. Updates editor windows and script modules.
  16. *
  17. * @note Internal method.
  18. */
  19. void update();
  20. /**
  21. * @brief Called when the user requests the application to close.
  22. *
  23. * @note Internal method.
  24. */
  25. void quitRequested();
  26. private:
  27. /**
  28. * @brief Triggers Program::OnInitialize callback. Should be called
  29. * after startup and after assembly reload.
  30. */
  31. void triggerOnInitialize();
  32. /**
  33. * @brief Triggered when an assembly refreshed finished.
  34. */
  35. void onAssemblyRefreshDone();
  36. /**
  37. * @brief Loads all managed types and methods used by this module.
  38. */
  39. void loadMonoTypes();
  40. static const float EDITOR_UPDATE_RATE;
  41. MonoAssembly* mEditorAssembly;
  42. float mLastUpdateTime;
  43. MonoClass* mProgramEdClass;
  44. MonoMethod* mUpdateMethod;
  45. HEvent mOnDomainLoadConn;
  46. HEvent mOnAssemblyRefreshDoneConn;
  47. };
  48. }