BsScriptEditorPlugin.cpp 886 B

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