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. private:
  21. /**
  22. * @brief Triggers Program::OnInitialize callback. Should be called
  23. * after startup and after assembly reload.
  24. */
  25. void triggerOnInitialize();
  26. /**
  27. * @brief Triggered when an assembly refreshed finished.
  28. */
  29. void onAssemblyRefreshDone();
  30. /**
  31. * @brief Loads all managed types and methods used by this module.
  32. */
  33. void loadMonoTypes();
  34. /**
  35. * @brief Triggers assembly refresh on next ::update.
  36. */
  37. static void debug_refreshAssembly();
  38. static const float EDITOR_UPDATE_RATE;
  39. MonoAssembly* mEditorAssembly;
  40. float mLastUpdateTime;
  41. MonoClass* mProgramEdClass;
  42. MonoMethod* mUpdateMethod;
  43. HEvent mOnDomainLoadConn;
  44. HEvent mOnAssemblyRefreshDoneConn;
  45. static bool mDebugRefresh;
  46. };
  47. }