BsEditorScriptManager.h 1.4 KB

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