BsScriptEditorPlugin.cpp 925 B

123456789101112131415161718192021222324252627282930
  1. #include "BsScriptEditorPrerequisites.h"
  2. #include "BsScriptEditorWindow.h"
  3. #include "BsMonoManager.h"
  4. #include "BsMonoAssembly.h"
  5. #include "BsRuntimeScriptObjects.h"
  6. namespace BansheeEngine
  7. {
  8. extern "C" BS_SCR_BED_EXPORT const String& getPluginName()
  9. {
  10. static String pluginName = "SBansheeEditor";
  11. return pluginName;
  12. }
  13. extern "C" BS_SCR_BED_EXPORT void* loadPlugin()
  14. {
  15. const String ENGINE_ASSEMBLY_PATH = "..\\..\\Assemblies\\MBansheeEditor.dll";
  16. const String ENGINE_ASSEMBLY_NAME = BansheeEditorAssemblyName;
  17. const String ASSEMBLY_ENTRY_POINT = "ProgramEd::Main";
  18. MonoAssembly& assembly = MonoManager::instance().loadAssembly(ENGINE_ASSEMBLY_PATH, ENGINE_ASSEMBLY_NAME);
  19. ScriptEditorWindow::registerManagedEditorWindows();
  20. RuntimeScriptObjects::instance().refreshScriptObjects(BansheeEditorAssemblyName);
  21. assembly.invoke(ASSEMBLY_ENTRY_POINT);
  22. return nullptr;
  23. }
  24. }