BsEditorScriptManager.h 1.5 KB

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