Browse Source

WIP VisualStudio project syncing
Renamed some assembly constants
Made Path and Util includes available by default

Marko Pintera 10 years ago
parent
commit
1b1895f796
100 changed files with 557 additions and 180 deletions
  1. 0 1
      BansheeCore/Include/BsResourceManifest.h
  2. 0 1
      BansheeCore/Include/BsResourceManifestRTTI.h
  3. 0 1
      BansheeCore/Source/BsCommandQueue.cpp
  4. 0 1
      BansheeCore/Source/BsCoreApplication.cpp
  5. 0 1
      BansheeCore/Source/BsGpuBufferView.cpp
  6. 0 1
      BansheeCore/Source/BsGpuProgIncludeImporter.cpp
  7. 0 1
      BansheeCore/Source/BsGpuProgramImporter.cpp
  8. 0 1
      BansheeCore/Source/BsImporter.cpp
  9. 0 1
      BansheeCore/Source/BsResourceManifest.cpp
  10. 0 1
      BansheeCore/Source/BsResources.cpp
  11. 0 1
      BansheeCore/Source/BsTextureView.cpp
  12. 0 1
      BansheeCore/Source/BsVertexDeclaration.cpp
  13. 0 1
      BansheeCore/Source/Win32/BsWin32BrowseDialogs.cpp
  14. 0 1
      BansheeCore/Source/Win32/BsWin32FolderMonitor.cpp
  15. 0 1
      BansheeD3D11RenderSystem/Source/BsD3D11GpuBufferView.cpp
  16. 0 1
      BansheeD3D11RenderSystem/Source/BsD3D11InputLayoutManager.cpp
  17. 0 1
      BansheeD3D11RenderSystem/Source/BsD3D11TextureView.cpp
  18. 0 1
      BansheeEditor/Include/BsBuiltinEditorResources.h
  19. 6 2
      BansheeEditor/Include/BsCodeEditor.h
  20. 17 2
      BansheeEditor/Include/BsEditorApplication.h
  21. 4 0
      BansheeEditor/Include/BsEditorPrerequisites.h
  22. 3 1
      BansheeEditor/Include/BsProjectLibrary.h
  23. 0 1
      BansheeEditor/Include/BsSelection.h
  24. 12 2
      BansheeEditor/Include/Win32/BsVSCodeEditor.h
  25. 73 4
      BansheeEditor/Source/BsCodeEditor.cpp
  26. 38 5
      BansheeEditor/Source/BsEditorApplication.cpp
  27. 0 1
      BansheeEditor/Source/BsGUIResourceTreeView.cpp
  28. 67 1
      BansheeEditor/Source/BsProjectLibrary.cpp
  29. 0 1
      BansheeEditor/Source/BsResourceImporter.cpp
  30. 61 25
      BansheeEditor/Source/Win32/BsVSCodeEditor.cpp
  31. 3 0
      BansheeEngine/BansheeEngine.vcxproj
  32. 9 0
      BansheeEngine/BansheeEngine.vcxproj.filters
  33. 10 0
      BansheeEngine/Include/BsApplication.h
  34. 0 1
      BansheeEngine/Include/BsBuiltinResources.h
  35. 6 1
      BansheeEngine/Include/BsPrerequisites.h
  36. 4 3
      BansheeEngine/Include/BsScriptCode.h
  37. 39 0
      BansheeEngine/Include/BsScriptCodeImportOptions.h
  38. 36 0
      BansheeEngine/Include/BsScriptCodeImportOptionsRTTI.h
  39. 3 0
      BansheeEngine/Include/BsScriptCodeImporter.h
  40. 4 0
      BansheeEngine/Include/BsScriptCodeRTTI.h
  41. 24 5
      BansheeEngine/Source/BsApplication.cpp
  42. 0 1
      BansheeEngine/Source/BsGUIManager.cpp
  43. 0 1
      BansheeEngine/Source/BsPlainTextImporter.cpp
  44. 6 6
      BansheeEngine/Source/BsScriptCode.cpp
  45. 24 0
      BansheeEngine/Source/BsScriptCodeImportOptions.cpp
  46. 14 2
      BansheeEngine/Source/BsScriptCodeImporter.cpp
  47. 0 1
      BansheeFBXImporter/Source/BsFBXImporter.cpp
  48. 0 1
      BansheeFontImporter/Source/BsFontImporter.cpp
  49. 0 1
      BansheeFreeImgImporter/Source/BsFreeImgImporter.cpp
  50. 0 1
      BansheeGLRenderSystem/Source/BsGLVertexArrayObjectManager.cpp
  51. 0 7
      BansheeGLRenderSystem/Source/GLSL/src/BsGLSLProgramPipelineManager.cpp
  52. 0 1
      BansheeMono/Source/BsMonoAssembly.cpp
  53. 0 1
      BansheeMono/Source/BsMonoClass.cpp
  54. 0 3
      BansheeUtility/Include/BsPath.h
  55. 3 1
      BansheeUtility/Include/BsPrerequisitesUtil.h
  56. 12 2
      BansheeUtility/Include/BsString.h
  57. 16 9
      BansheeUtility/Include/BsStringFormat.h
  58. 2 4
      BansheeUtility/Include/BsUtil.h
  59. 2 2
      BansheeUtility/Include/ThirdParty/md5.h
  60. 0 1
      BansheeUtility/Source/BsDebug.cpp
  61. 0 1
      BansheeUtility/Source/BsFileSerializer.cpp
  62. 1 1
      BansheeUtility/Source/BsPath.cpp
  63. 10 0
      BansheeUtility/Source/BsString.cpp
  64. 1 1
      BansheeUtility/Source/BsUtil.cpp
  65. 1 9
      BansheeUtility/Source/ThirdParty/md5.cpp
  66. 0 1
      BansheeUtility/Source/Win32/BsFileSystem.cpp
  67. 1 1
      SBansheeEditor/Include/BsScriptBrowseDialog.h
  68. 3 4
      SBansheeEditor/Include/BsScriptDragDropManager.h
  69. 0 2
      SBansheeEditor/Include/BsScriptEditorPrerequisites.h
  70. 1 1
      SBansheeEditor/Include/BsScriptEditorSettings.h
  71. 1 1
      SBansheeEditor/Include/BsScriptEditorUtility.h
  72. 1 1
      SBansheeEditor/Include/BsScriptEditorWindow.h
  73. 1 1
      SBansheeEditor/Include/BsScriptGUIColorField.h
  74. 1 1
      SBansheeEditor/Include/BsScriptGUIComponentFoldout.h
  75. 1 1
      SBansheeEditor/Include/BsScriptGUIFloatField.h
  76. 1 1
      SBansheeEditor/Include/BsScriptGUIFoldout.h
  77. 1 1
      SBansheeEditor/Include/BsScriptGUIGameObjectField.h
  78. 1 1
      SBansheeEditor/Include/BsScriptGUIIntField.h
  79. 1 1
      SBansheeEditor/Include/BsScriptGUIPanelContainer.h
  80. 1 1
      SBansheeEditor/Include/BsScriptGUIResourceField.h
  81. 1 1
      SBansheeEditor/Include/BsScriptGUITextField.h
  82. 1 1
      SBansheeEditor/Include/BsScriptGUIToggleField.h
  83. 1 1
      SBansheeEditor/Include/BsScriptGUIVector2Field.h
  84. 1 1
      SBansheeEditor/Include/BsScriptGUIVector3Field.h
  85. 1 1
      SBansheeEditor/Include/BsScriptGUIVector4Field.h
  86. 1 1
      SBansheeEditor/Include/BsScriptGizmos.h
  87. 1 1
      SBansheeEditor/Include/BsScriptHandleDrawing.h
  88. 1 1
      SBansheeEditor/Include/BsScriptHandleSlider.h
  89. 1 1
      SBansheeEditor/Include/BsScriptHandleSliderDisc.h
  90. 1 1
      SBansheeEditor/Include/BsScriptHandleSliderLine.h
  91. 1 1
      SBansheeEditor/Include/BsScriptHandleSliderPlane.h
  92. 4 4
      SBansheeEditor/Include/BsScriptImportOptions.h
  93. 1 1
      SBansheeEditor/Include/BsScriptModalWindow.h
  94. 4 4
      SBansheeEditor/Include/BsScriptProjectLibrary.h
  95. 1 1
      SBansheeEditor/Include/BsScriptSceneViewHandler.h
  96. 1 1
      SBansheeEditor/Include/BsScriptSelection.h
  97. 6 5
      SBansheeEditor/Source/BsEditorScriptManager.cpp
  98. 0 1
      SBansheeEditor/Source/BsScriptBrowseDialog.cpp
  99. 2 2
      SBansheeEditor/Source/BsScriptEditorWindow.cpp
  100. 1 1
      SBansheeEditor/Source/BsScriptGizmoManager.cpp

+ 0 - 1
BansheeCore/Include/BsResourceManifest.h

@@ -2,7 +2,6 @@
 
 #include "BsCorePrerequisites.h"
 #include "BsIReflectable.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Include/BsResourceManifestRTTI.h

@@ -3,7 +3,6 @@
 #include "BsCorePrerequisites.h"
 #include "BsRTTIType.h"
 #include "BsResourceManifest.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Source/BsCommandQueue.cpp

@@ -2,7 +2,6 @@
 #include "BsException.h"
 #include "BsCoreThread.h"
 #include "BsDebug.h"
-#include "BsUtil.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Source/BsCoreApplication.cpp

@@ -41,7 +41,6 @@
 #include "BsMessageHandler.h"
 #include "BsResourceListenerManager.h"
 #include "BsRenderStateManager.h"
-#include "BsPath.h"
 
 #include "BsMaterial.h"
 #include "BsShader.h"

+ 0 - 1
BansheeCore/Source/BsGpuBufferView.cpp

@@ -1,5 +1,4 @@
 #include "BsGpuBufferView.h"
-#include "BsUtil.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Source/BsGpuProgIncludeImporter.cpp

@@ -1,6 +1,5 @@
 #include "BsGpuProgIncludeImporter.h"
 #include "BsGpuProgInclude.h"
-#include "BsPath.h"
 #include "BsDataStream.h"
 #include "BsFileSystem.h"
 

+ 0 - 1
BansheeCore/Source/BsGpuProgramImporter.cpp

@@ -1,5 +1,4 @@
 #include "BsGpuProgramImporter.h"
-#include "BsPath.h"
 #include "BsDataStream.h"
 #include "BsFileSystem.h"
 #include "BsGpuProgramImportOptions.h"

+ 0 - 1
BansheeCore/Source/BsImporter.cpp

@@ -1,5 +1,4 @@
 #include "BsImporter.h"
-#include "BsPath.h"
 #include "BsResource.h"
 #include "BsFileSystem.h"
 #include "BsSpecificImporter.h"

+ 0 - 1
BansheeCore/Source/BsResourceManifest.cpp

@@ -1,6 +1,5 @@
 #include "BsResourceManifest.h"
 #include "BsResourceManifestRTTI.h"
-#include "BsPath.h"
 #include "BsFileSerializer.h"
 #include "BsException.h"
 

+ 0 - 1
BansheeCore/Source/BsResources.cpp

@@ -6,7 +6,6 @@
 #include "BsFileSystem.h"
 #include "BsTaskScheduler.h"
 #include "BsUUID.h"
-#include "BsPath.h"
 #include "BsDebug.h"
 #include "BsUtility.h"
 #include "BsSavedResourceData.h"

+ 0 - 1
BansheeCore/Source/BsTextureView.cpp

@@ -1,6 +1,5 @@
 #include "BsTextureView.h"
 #include "BsTexture.h"
-#include "BsUtil.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Source/BsVertexDeclaration.cpp

@@ -2,7 +2,6 @@
 #include "BsVertexDeclarationRTTI.h"
 #include "BsHardwareBufferManager.h"
 #include "BsRenderAPI.h"
-#include "BsUtil.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeCore/Source/Win32/BsWin32BrowseDialogs.cpp

@@ -1,5 +1,4 @@
 #include "BsPlatform.h"
-#include "BsPath.h"
 #include <atlbase.h>
 #include <ShObjIdl.h>
 

+ 0 - 1
BansheeCore/Source/Win32/BsWin32FolderMonitor.cpp

@@ -1,7 +1,6 @@
 #include "Win32/BsWin32FolderMonitor.h"
 #include "BsFileSystem.h"
 #include "BsException.h"
-#include "BsPath.h"
 
 #include "BsDebug.h"
 

+ 0 - 1
BansheeD3D11RenderSystem/Source/BsD3D11GpuBufferView.cpp

@@ -2,7 +2,6 @@
 #include "BsD3D11GpuBuffer.h"
 #include "BsD3D11RenderAPI.h"
 #include "BsD3D11Device.h"
-#include "BsUtil.h"
 #include "BsRenderStats.h"
 #include "BsException.h"
 

+ 0 - 1
BansheeD3D11RenderSystem/Source/BsD3D11InputLayoutManager.cpp

@@ -6,7 +6,6 @@
 #include "BsHardwareBufferManager.h"
 #include "BsRenderStats.h"
 #include "BsDebug.h"
-#include "BsUtil.h"
 
 namespace BansheeEngine
 {

+ 0 - 1
BansheeD3D11RenderSystem/Source/BsD3D11TextureView.cpp

@@ -2,7 +2,6 @@
 #include "BsD3D11RenderAPI.h"
 #include "BsD3D11Device.h"
 #include "BsD3D11Texture.h"
-#include "BsUtil.h"
 #include "BsRenderStats.h"
 #include "BsException.h"
 

+ 0 - 1
BansheeEditor/Include/BsBuiltinEditorResources.h

@@ -3,7 +3,6 @@
 #include "BsEditorPrerequisites.h"
 #include "BsGUISkin.h"
 #include "BsModule.h"
-#include "BsPath.h"
 #include "BsApplication.h"
 
 namespace BansheeEngine

+ 6 - 2
BansheeEditor/Include/BsCodeEditor.h

@@ -20,11 +20,13 @@ namespace BansheeEngine
 		Vector<Path> codeFiles;
 		Vector<Path> nonCodeFiles;
 		Vector<WString> defines;
-		Vector<CodeProjectReference> references;
+		Vector<CodeProjectReference> assemblyReferences;
+		Vector<CodeProjectReference> projectReferences;
 	};
 
 	struct BS_ED_EXPORT CodeSolutionData
 	{
+		WString name;
 		Vector<CodeProjectData> projects;
 	};
 
@@ -38,9 +40,11 @@ namespace BansheeEngine
 		void setActive(const WString& editor);
 
 		void openFile(const Path& path, UINT32 lineNumber) const;
-		void syncSolution(const CodeSolutionData& data, const Path& outputPath) const; // TODO - Need some kind of project information like: name, list of files, list of references, possibly defines and other?
+		void syncSolution() const;
 
 	private:
+		Path getSolutionPath() const;
+
 		CodeEditor* mActiveEditor;
 		Map<WString, CodeEditorFactory*> mFactoryPerEditor;
 		Vector<WString> mEditors;

+ 17 - 2
BansheeEditor/Include/BsEditorApplication.h

@@ -2,7 +2,6 @@
 
 #include "BsEditorPrerequisites.h"
 #include "BsApplication.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {
@@ -17,7 +16,23 @@ namespace BansheeEngine
 		bool isProjectLoaded() const;
 		bool isGameViewFocused() const;
 		bool isSceneViewFocused() const;
-		const Path& getActiveProjectPath() const;
+		const Path& getProjectPath() const;
+		const WString& getProjectName() const;
+
+		/**
+		 * @brief	Returns the absolute path to the built-in managed editor assembly file.
+		 */
+		Path getEditorAssemblyPath() const;
+
+		/**
+		 * @brief	Returns the absolute path of the managed editor script assembly file.
+		 */
+		Path getEditorScriptAssemblyPath() const;
+
+		/**
+		 * @copydoc	Application::getGameAssemblyPath
+		 */
+		Path getGameAssemblyPath() const override;
 
 		EditorSettingsPtr getEditorSettings() const { return mEditorSettings; }
 

+ 4 - 0
BansheeEditor/Include/BsEditorPrerequisites.h

@@ -72,6 +72,10 @@ namespace BansheeEngine
 	typedef std::shared_ptr<EditorWidgetLayout> EditorWidgetLayoutPtr;
 	typedef std::shared_ptr<EditorSettings> EditorSettingsPtr;
 
+	static const char* EDITOR_ASSEMBLY = "MBansheeEditor";
+	static const char* SCRIPT_EDITOR_ASSEMBLY = "MScriptEditor";
+	static const Path INTERNAL_ASSEMBLY_PATH = "Internal//Assemblies//";
+
 	enum class DragAndDropType
 	{
 		EditorWidget = 10000,

+ 3 - 1
BansheeEditor/Include/BsProjectLibrary.h

@@ -2,7 +2,6 @@
 
 #include "BsEditorPrerequisites.h"
 #include "BsModule.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {
@@ -58,6 +57,9 @@ namespace BansheeEngine
 		const LibraryEntry* getRootEntry() const { return mRootEntry; }
 		LibraryEntry* findEntry(const Path& fullPath) const;
 
+		Vector<LibraryEntry*> search(const WString& pattern);
+		Vector<LibraryEntry*> search(const WString& pattern, const Vector<UINT32>& typeIds);
+
 		ProjectResourceMetaPtr findResourceMeta(const String& uuid) const;
 		Path uuidToPath(const String& uuid) const;
 

+ 0 - 1
BansheeEditor/Include/BsSelection.h

@@ -2,7 +2,6 @@
 
 #include "BsEditorPrerequisites.h"
 #include "BsModule.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {

+ 12 - 2
BansheeEditor/Include/Win32/BsVSCodeEditor.h

@@ -2,19 +2,28 @@
 
 #include "BsEditorPrerequisites.h"
 #include "BsCodeEditor.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {
+	enum class VisualStudioVersion
+	{
+		VS2008,
+		VS2010,
+		VS2012,
+		VS2013,
+		VS2015
+	};
+
 	class BS_ED_EXPORT VSCodeEditor : public CodeEditor
 	{
 	public:
-		VSCodeEditor(const Path& execPath, const WString& CLSID);
+		VSCodeEditor(VisualStudioVersion version, const Path& execPath, const WString& CLSID);
 
 		void openFile(const Path& solutionPath, const Path& filePath, UINT32 lineNumber) const override;
 		void syncSolution(const CodeSolutionData& data, const Path& outputPath) const override;
 
 	private:
+		VisualStudioVersion mVersion;
 		Path mExecPath;
 		WString mCLSID;
 	};
@@ -33,6 +42,7 @@ namespace BansheeEngine
 			WString name;
 			Path execPath;
 			WString CLSID;
+			VisualStudioVersion version;
 		};
 
 		Map<WString, VSVersionInfo> getAvailableVersions() const;

+ 73 - 4
BansheeEditor/Source/BsCodeEditor.cpp

@@ -1,4 +1,8 @@
 #include "BsCodeEditor.h"
+#include "BsEditorApplication.h"
+#include "BsProjectLibrary.h"
+#include "BsProjectResourceMeta.h"
+#include "BsScriptCodeImportOptions.h"
 
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 #include "Win32/BsVSCodeEditor.h"
@@ -53,12 +57,77 @@ namespace BansheeEngine
 	void CodeEditorManager::openFile(const Path& path, UINT32 lineNumber) const
 	{
 		if (mActiveEditor != nullptr)
-			mActiveEditor->openFile(path, lineNumber);
+			mActiveEditor->openFile(getSolutionPath(), path, lineNumber);
 	}
 
-	void CodeEditorManager::syncSolution(const CodeSolutionData& data, const Path& outputPath) const
+	void CodeEditorManager::syncSolution() const
 	{
-		if (mActiveEditor != nullptr)
-			mActiveEditor->syncSolution(data, outputPath);
+		if (mActiveEditor == nullptr)
+			return;
+
+		CodeSolutionData slnData;
+		slnData.name = gEditorApplication().getProjectName();
+
+		Vector<UINT32> scriptTypeIds =
+		{
+			TID_ScriptCode, TID_PlainText, TID_GpuProgram, TID_GpuProgramInclude
+		};
+
+		Vector<ProjectLibrary::LibraryEntry*> libraryEntries = ProjectLibrary::instance().search(L"*", scriptTypeIds);
+		
+		// Game project
+		slnData.projects.push_back(CodeProjectData());
+		CodeProjectData& gameProject = slnData.projects.back();
+		gameProject.name = toWString(SCRIPT_GAME_ASSEMBLY);
+		
+		//// Add references
+		gameProject.assemblyReferences.push_back(CodeProjectReference{ L"System", Path::BLANK });
+		gameProject.assemblyReferences.push_back(CodeProjectReference{ L"BansheeEngine", gApplication().getEngineAssemblyPath() });
+
+		// Editor project
+		slnData.projects.push_back(CodeProjectData());
+		CodeProjectData& editorProject = slnData.projects.back();
+		editorProject.name = toWString(SCRIPT_EDITOR_ASSEMBLY);
+
+		//// Add references
+		editorProject.assemblyReferences.push_back(CodeProjectReference{ L"System", Path::BLANK });
+		editorProject.assemblyReferences.push_back(CodeProjectReference{ L"BansheeEngine", gApplication().getEngineAssemblyPath() });
+		editorProject.assemblyReferences.push_back(CodeProjectReference{ L"BansheeEditor", gEditorApplication().getEditorAssemblyPath() });
+
+		editorProject.projectReferences.push_back(CodeProjectReference{ gameProject.name, Path::BLANK});
+
+		//// Add files for both projects
+		for (auto& entry : libraryEntries)
+		{
+			if (entry->type != ProjectLibrary::LibraryEntryType::File)
+				continue;
+
+			ProjectLibrary::ResourceEntry* resEntry = static_cast<ProjectLibrary::ResourceEntry*>(entry);
+			if (resEntry->meta->getTypeID() == TID_ScriptCode)
+			{
+				SPtr<ScriptCodeImportOptions> scriptIO = std::static_pointer_cast<ScriptCodeImportOptions>(resEntry->meta->getImportOptions());
+
+				bool isEditorScript = false;
+				if (scriptIO != nullptr)
+					isEditorScript = scriptIO->isEditorScript();
+
+				if (isEditorScript)
+					editorProject.codeFiles.push_back(resEntry->path);
+				else
+					gameProject.codeFiles.push_back(resEntry->path);
+			}
+			else
+				gameProject.nonCodeFiles.push_back(resEntry->path);
+		}
+
+		mActiveEditor->syncSolution(slnData, getSolutionPath());
+	}
+
+	Path CodeEditorManager::getSolutionPath() const
+	{
+		Path path = gEditorApplication().getProjectPath();
+		path.append(gEditorApplication().getProjectName() + L".sln");
+
+		return path;
 	}
 }

+ 38 - 5
BansheeEditor/Source/BsEditorApplication.cpp

@@ -7,7 +7,6 @@
 #include "BsUndoRedo.h"
 #include "BsFileSerializer.h"
 #include "BsFileSystem.h"
-#include "BsPath.h"
 #include "BsResourceImporter.h"
 #include "BsEditorWidgetLayout.h"
 #include "BsScenePicking.h"
@@ -83,7 +82,7 @@ namespace BansheeEngine
 		ResourceImporter* resourceImporter = bs_new<ResourceImporter>();
 		Importer::instance()._registerAssetImporter(resourceImporter);
 
-		ProjectLibrary::startUp(getActiveProjectPath());
+		ProjectLibrary::startUp(getProjectPath());
 
 		UndoRedo::startUp();
 		EditorWindowManager::startUp();
@@ -413,16 +412,50 @@ namespace BansheeEngine
 		return true; // TODO
 	}
 
-	const Path& EditorApplication::getActiveProjectPath() const
+	const Path& EditorApplication::getProjectPath() const
 	{
 		static Path dummyProjectPath = L"D:\\DummyBansheeProject\\";
 
 		return dummyProjectPath;
 	}
 
+	const WString& EditorApplication::getProjectName() const
+	{
+		static WString dummyProjectName = L"DummyBansheeProject";
+
+		return dummyProjectName;
+	}
+
+	Path EditorApplication::getEditorAssemblyPath() const
+	{
+		Path assemblyPath = FileSystem::getWorkingDirectoryPath();
+		assemblyPath.append(ASSEMBLY_PATH);
+		assemblyPath.append(toWString(EDITOR_ASSEMBLY) + L".dll");
+
+		return assemblyPath;
+	}
+
+	Path EditorApplication::getEditorScriptAssemblyPath() const
+	{
+		Path assemblyPath = getProjectPath();
+		assemblyPath.append(INTERNAL_ASSEMBLY_PATH);
+		assemblyPath.append(toWString(SCRIPT_EDITOR_ASSEMBLY) + L".dll");
+
+		return assemblyPath;
+	}
+
+	Path EditorApplication::getGameAssemblyPath() const
+	{
+		Path assemblyPath = getProjectPath();
+		assemblyPath.append(INTERNAL_ASSEMBLY_PATH);
+		assemblyPath.append(toWString(SCRIPT_GAME_ASSEMBLY) + L".dll");
+
+		return assemblyPath;
+	}
+
 	EditorWidgetLayoutPtr EditorApplication::loadWidgetLayout()
 	{
-		Path layoutPath = getActiveProjectPath();
+		Path layoutPath = getProjectPath();
 		layoutPath.append(WIDGET_LAYOUT_PATH);
 
 		if(FileSystem::exists(layoutPath))
@@ -436,7 +469,7 @@ namespace BansheeEngine
 
 	void EditorApplication::saveWidgetLayout(const EditorWidgetLayoutPtr& layout)
 	{
-		Path layoutPath = getActiveProjectPath();
+		Path layoutPath = getProjectPath();
 		layoutPath.append(WIDGET_LAYOUT_PATH);
 
 		FileEncoder fs(layoutPath);

+ 0 - 1
BansheeEditor/Source/BsGUIResourceTreeView.cpp

@@ -10,7 +10,6 @@
 #include "BsViewport.h"
 #include "BsRenderWindow.h"
 #include "BsPlatform.h"
-#include "BsPath.h"
 #include "BsSelection.h"
 
 using namespace std::placeholders;

+ 67 - 1
BansheeEditor/Source/BsProjectLibrary.cpp

@@ -1,5 +1,4 @@
 #include "BsProjectLibrary.h"
-#include "BsPath.h"
 #include "BsFileSystem.h"
 #include "BsException.h"
 #include "BsResources.h"
@@ -15,6 +14,7 @@
 #include "BsProjectLibraryEntries.h"
 #include "BsResource.h"
 #include "BsResourceImporter.h"
+#include <regex>
 
 using namespace std::placeholders;
 
@@ -431,6 +431,72 @@ namespace BansheeEngine
 		return lastModifiedTime <= resource->lastUpdateTime;
 	}
 
+	Vector<ProjectLibrary::LibraryEntry*> ProjectLibrary::search(const WString& pattern)
+	{
+		return search(pattern, {});
+	}
+
+	Vector<ProjectLibrary::LibraryEntry*> ProjectLibrary::search(const WString& pattern, const Vector<UINT32>& typeIds)
+	{
+		Vector<LibraryEntry*> foundEntries;
+
+		std::wregex escape(L"[.^$|()\\[\\]{}*+?\\\\]");
+		WString replace(L"\\\\&");
+		WString escapedPattern = std::regex_replace(pattern, escape, replace, std::regex_constants::match_default | std::regex_constants::format_sed);
+
+		std::wregex wildcard(L"\\\\\\*");
+		WString wildcardReplace(L".*");
+		WString searchPattern = std::regex_replace(escapedPattern, wildcard, L".*");
+
+		std::wregex searchRegex(searchPattern);
+
+		Stack<DirectoryEntry*> todo;
+		todo.push(mRootEntry);
+		while (!todo.empty())
+		{
+			DirectoryEntry* dirEntry = todo.top();
+			todo.pop();
+
+			for (auto& child : dirEntry->mChildren)
+			{
+				if (std::regex_match(child->elementName, searchRegex))
+				{
+					if (typeIds.size() == 0)
+						foundEntries.push_back(child);
+					else
+					{
+						if (child->type == LibraryEntryType::File)
+						{
+							ResourceEntry* childResEntry = static_cast<ResourceEntry*>(child);
+							for (auto& typeId : typeIds)
+							{
+								if (childResEntry->meta->getTypeID() == typeId)
+								{
+									foundEntries.push_back(child);
+									break;
+								}
+							}
+						}
+					}
+				}
+
+				if (child->type == LibraryEntryType::Directory)
+				{
+					DirectoryEntry* childDirEntry = static_cast<DirectoryEntry*>(child);
+					todo.push(childDirEntry);
+				}
+			}
+		}
+
+		std::sort(foundEntries.begin(), foundEntries.end(), 
+			[&](const LibraryEntry* a, const LibraryEntry* b) 
+		{ 
+			return a->elementName.compare(b->elementName);
+		});
+
+		return foundEntries;
+	}
+
 	ProjectLibrary::LibraryEntry* ProjectLibrary::findEntry(const Path& fullPath) const
 	{
 		if (!mRootEntry->path.includes(fullPath))

+ 0 - 1
BansheeEditor/Source/BsResourceImporter.cpp

@@ -1,5 +1,4 @@
 #include "BsResourceImporter.h"
-#include "BsPath.h"
 #include "BsFileSerializer.h"
 #include "BsResource.h"
 

+ 61 - 25
BansheeEditor/Source/Win32/BsVSCodeEditor.cpp

@@ -1,22 +1,14 @@
 #include "Win32/BsVSCodeEditor.h"
 #include <windows.h>
 #include <atlbase.h>
-#include "BsUtil.h"
+#include "BsFileSystem.h"
+#include "BsDataStream.h"
 
 // Import EnvDTE
 #import "libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version("8.0") lcid("0") raw_interfaces_only named_guids
 
 namespace BansheeEngine
 {
-	enum class VisualStudioVersion
-	{
-		VS2008,
-		VS2010,
-		VS2012,
-		VS2013,
-		VS2015
-	};
-
 	LONG getRegistryStringValue(HKEY hKey, const WString& name, WString& value, const WString& defaultValue)
 	{
 		value = defaultValue;
@@ -46,6 +38,7 @@ namespace BansheeEngine
 
 		static const WString PROJ_TEMPLATE;
 		static const WString REFERENCE_ENTRY_TEMPLATE;
+		static const WString REFERENCE_PROJECT_ENTRY_TEMPLATE;
 		static const WString REFERENCE_PATH_ENTRY_TEMPLATE;
 		static const WString CODE_ENTRY_TEMPLATE;
 		static const WString NON_CODE_ENTRY_TEMPLATE;
@@ -79,7 +72,9 @@ namespace BansheeEngine
 					if (result != S_OK)
 						continue;
 
-					CComPtr<EnvDTE::_DTE> dte = curObject;
+					CComPtr<EnvDTE::_DTE> dte;
+					curObject->QueryInterface(__uuidof(EnvDTE::_DTE), (void**)&dte);
+
 					if (dte == nullptr)
 						return nullptr;
 
@@ -105,7 +100,9 @@ namespace BansheeEngine
 			if (FAILED(::CoCreateInstance(clsid, nullptr, CLSCTX_LOCAL_SERVER, EnvDTE::IID__DTE, (LPVOID*)&newInstance)))
 				return nullptr;
 
-			CComPtr<EnvDTE::_DTE> dte = newInstance;
+			CComPtr<EnvDTE::_DTE> dte;
+			newInstance->QueryInterface(__uuidof(EnvDTE::_DTE), (void**)&dte);
+
 			if (dte == nullptr)
 				return nullptr;
 
@@ -192,7 +189,7 @@ namespace BansheeEngine
 			return StringUtil::format(guidTemplate, hash.substr(0, 8), hash.substr(8, 4), hash.substr(12, 4), hash.substr(16, 4), hash.substr(20, 12));
 		}
 
-		static WString writeSolution(VisualStudioVersion version, const WString& name, const Vector<VSProjectInfo>& projects)
+		static WString writeSolution(VisualStudioVersion version, const CodeSolutionData& data)
 		{
 			struct VersionData
 			{
@@ -208,14 +205,16 @@ namespace BansheeEngine
 				{ VisualStudioVersion::VS2015, { L"12.0" } }
 			};
 
-			String solutionGUID = getSolutionGUID(name);
+			WString solutionGUID = toWString(getSolutionGUID(data.name));
 
 			WStringStream projectEntriesStream;
 			WStringStream projectPlatformsStream;
-			for (auto& project : projects)
+			for (auto& project : data.projects)
 			{
-				projectEntriesStream << StringUtil::format(PROJ_ENTRY_TEMPLATE, toWString(solutionGUID), project.name, project.path.toWString(), project.GUID) << std::endl;
-				projectPlatformsStream << StringUtil::format(PROJ_PLATFORM_TEMPLATE, project.GUID) << std::endl;
+				WString guid = toWString(getProjectGUID(project.name));
+
+				projectEntriesStream << StringUtil::format(PROJ_ENTRY_TEMPLATE, solutionGUID, project.name, project.name + L".csproj", guid) << std::endl;
+				projectPlatformsStream << StringUtil::format(PROJ_PLATFORM_TEMPLATE, guid) << std::endl;
 			}
 
 			WString projectEntries = projectEntriesStream.str();
@@ -255,7 +254,7 @@ namespace BansheeEngine
 			tempStream.str(L"");
 			tempStream.clear();
 
-			for (auto& referenceEntry : projectData.references)
+			for (auto& referenceEntry : projectData.assemblyReferences)
 			{
 				if (referenceEntry.path.isEmpty())
 					tempStream << StringUtil::format(REFERENCE_ENTRY_TEMPLATE, referenceEntry.name) << std::endl;
@@ -267,6 +266,16 @@ namespace BansheeEngine
 			tempStream.str(L"");
 			tempStream.clear();
 
+			for (auto& referenceEntry : projectData.projectReferences)
+			{
+				WString projectGUID = toWString(getProjectGUID(referenceEntry.name));
+				tempStream << StringUtil::format(REFERENCE_PROJECT_ENTRY_TEMPLATE, referenceEntry.name, projectGUID) << std::endl;
+			}
+
+			WString projectReferenceEntries = tempStream.str();
+			tempStream.str(L"");
+			tempStream.clear();
+
 			for (auto& define : projectData.defines)
 				tempStream << define << L";";
 
@@ -274,7 +283,7 @@ namespace BansheeEngine
 			WString projectGUID = toWString(getProjectGUID(projectData.name));
 
 			return StringUtil::format(PROJ_ENTRY_TEMPLATE, versionData[version].toolsVersion, projectGUID, 
-				projectData.name, defines, referenceEntries, codeEntries, nonCodeEntries);
+				projectData.name, defines, referenceEntries, projectReferenceEntries, codeEntries, nonCodeEntries);
 		}
 	};
 
@@ -346,6 +355,9 @@ EndProject)";
   </ItemGroup>
   <ItemGroup>
 {6}
+  </ItemGroup>
+  <ItemGroup>
+{7}
   </ItemGroup>
   <Import Project = "$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
 </Project>)literal";
@@ -358,14 +370,20 @@ EndProject)";
       <HintPath>{1}</HintPath>
     </Reference>)";
 
+	const WString VisualStudio::REFERENCE_PROJECT_ENTRY_TEMPLATE =
+		LR"(    <ProjectReference Include="{0}.csproj">
+      <Project>\{{1}\}</Project>
+      <Name>{0}</Name>
+    </ProjectReference>)";
+
 	const WString VisualStudio::CODE_ENTRY_TEMPLATE =
 		LR"(    <Compile Include="{0}"/>)";
 
-	const WString VisualStudio::NO_CODE_ENTRY_TEMPLATE =
+	const WString VisualStudio::NON_CODE_ENTRY_TEMPLATE =
 		LR"(    <None Include="{0}"/>)";
 
-	VSCodeEditor::VSCodeEditor(const Path& execPath, const WString& CLSID)
-		:mCLSID(CLSID), mExecPath(execPath)
+	VSCodeEditor::VSCodeEditor(VisualStudioVersion version, const Path& execPath, const WString& CLSID)
+		:mCLSID(CLSID), mExecPath(execPath), mVersion(version)
 	{
 		
 	}
@@ -373,7 +391,7 @@ EndProject)";
 	void VSCodeEditor::openFile(const Path& solutionPath, const Path& filePath, UINT32 lineNumber) const
 	{
 		CLSID clsID;
-		if (FAILED(CLSIDFromString(mCLSID.toWString().c_str(), &clsID)))
+		if (FAILED(CLSIDFromString(mCLSID.c_str(), &clsID)))
 			return;
 
 		CComPtr<EnvDTE::_DTE> dte = VisualStudio::findRunningInstance(clsID, solutionPath);
@@ -388,7 +406,24 @@ EndProject)";
 
 	void VSCodeEditor::syncSolution(const CodeSolutionData& data, const Path& outputPath) const
 	{
-		// TODO
+		WString solutionString = VisualStudio::writeSolution(mVersion, data);
+		Path solutionPath = outputPath;
+		solutionPath.append(data.name + L".sln");
+
+		for (auto& project : data.projects)
+		{
+			WString projectString = VisualStudio::writeProject(mVersion, project);
+			Path projectPath = outputPath;
+			projectPath.append(project.name + L".csproj");
+
+			DataStreamPtr projectStream = FileSystem::createAndOpenFile(projectPath);
+			projectStream->write(projectString.c_str(), projectString.size());
+			projectStream->close();
+		}
+
+		DataStreamPtr solutionStream = FileSystem::createAndOpenFile(solutionPath);
+		solutionStream->write(solutionString.c_str(), solutionString.size());
+		solutionStream->close();
 	}
 
 	VSCodeEditorFactory::VSCodeEditorFactory()
@@ -451,6 +486,7 @@ EndProject)";
 			info.name = version.second.name;
 			info.execPath = installPath.append(version.second.executable);
 			info.CLSID = clsID;
+			info.version = version.first;
 
 			versionInfo[info.name] = info;
 		}
@@ -468,6 +504,6 @@ EndProject)";
 
 		// TODO - Also create VSExpress and VSCommunity editors
 
-		return bs_new<VSCodeEditor>(findIter->second.execPath, findIter->second.CLSID);
+		return bs_new<VSCodeEditor>(findIter->second.version, findIter->second.execPath, findIter->second.CLSID);
 	}
 }

+ 3 - 0
BansheeEngine/BansheeEngine.vcxproj

@@ -249,6 +249,7 @@
     <ClCompile Include="Source\BsRenderQueue.cpp" />
     <ClCompile Include="Source\BsScriptCode.cpp" />
     <ClCompile Include="Source\BsScriptCodeImporter.cpp" />
+    <ClCompile Include="Source\BsScriptCodeImportOptions.cpp" />
     <ClCompile Include="Source\BsVirtualInput.cpp" />
     <ClInclude Include="Include\BsApplication.h" />
     <ClInclude Include="Include\BsCameraHandler.h" />
@@ -267,6 +268,8 @@
     <ClInclude Include="Include\BsRenderer.h" />
     <ClInclude Include="Include\BsScriptCode.h" />
     <ClInclude Include="Include\BsScriptCodeImporter.h" />
+    <ClInclude Include="Include\BsScriptCodeImportOptions.h" />
+    <ClInclude Include="Include\BsScriptCodeImportOptionsRTTI.h" />
     <ClInclude Include="Include\BsScriptCodeRTTI.h" />
     <ClInclude Include="Include\BsShapeMeshes3D.h" />
     <ClInclude Include="Include\BsDragAndDropManager.h" />

+ 9 - 0
BansheeEngine/BansheeEngine.vcxproj.filters

@@ -311,6 +311,12 @@
     <ClInclude Include="Include\BsScriptCodeRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
+    <ClInclude Include="Include\BsScriptCodeImportOptions.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptCodeImportOptionsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsGUIElement.cpp">
@@ -538,5 +544,8 @@
     <ClCompile Include="Source\BsScriptCodeImporter.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="Source\BsScriptCodeImportOptions.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 10 - 0
BansheeEngine/Include/BsApplication.h

@@ -49,6 +49,16 @@ namespace BansheeEngine
 		 */
 		ViewportPtr getPrimaryViewport() const;
 
+		/**
+		 * @brief	Returns the absolute path to the builtin managed engine assembly file.
+		 */
+		Path getEngineAssemblyPath() const;
+
+		/**
+		 * @brief	Returns the absolute path to the game managed assembly file.
+		 */
+		virtual Path getGameAssemblyPath() const;
+
 	protected:
 		/**
 		 * @copydoc	Module::onStartUp

+ 0 - 1
BansheeEngine/Include/BsBuiltinResources.h

@@ -3,7 +3,6 @@
 #include "BsPrerequisites.h"
 #include "BsGUISkin.h"
 #include "BsModule.h"
-#include "BsPath.h"
 #include "BsVector2I.h"
 #include "BsGUIMaterialInfo.h"
 #include "BsDebugDrawMaterialInfo.h"

+ 6 - 1
BansheeEngine/Include/BsPrerequisites.h

@@ -124,6 +124,10 @@ namespace BansheeEngine
 	typedef ResourceHandle<PlainText> HPlainText;
 	typedef ResourceHandle<ScriptCode> HScriptCode;
 
+	static const char* ENGINE_ASSEMBLY = "MBansheeEngine";
+	static const char* SCRIPT_GAME_ASSEMBLY = "MScriptGame";
+	static const Path ASSEMBLY_PATH = "..\\..\\Assemblies\\";
+
 	/**
 	 * @brief	RTTI types.
 	 */
@@ -135,6 +139,7 @@ namespace BansheeEngine
 		TID_CameraHandler = 30003,
 		TID_RenderableHandler = 30004,
 		TID_PlainText = 30005,
-		TID_ScriptCode = 30006
+		TID_ScriptCode = 30006,
+		TID_ScriptCodeImportOptions = 30007
 	};
 }

+ 4 - 3
BansheeEngine/Include/BsScriptCode.h

@@ -19,18 +19,19 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new script code resource with the specified source code.
 		 */
-		static HScriptCode create(const WString& data);
+		static HScriptCode create(const WString& data, bool editorScript = false);
 
 		/**
 		 * @brief	Creates an include file resource with the specified include string.
 		 *
 		 * @note	Internal method. Use "create" for normal use.
 		 */
-		static ScriptCodePtr _createPtr(const WString& data);
+		static ScriptCodePtr _createPtr(const WString& data, bool editorScript = false);
 	private:
-		ScriptCode(const WString& data);
+		ScriptCode(const WString& data, bool editorScript);
 
 		WString mString;
+		bool mEditorScript;
 
 		/************************************************************************/
 		/* 								SERIALIZATION                      		*/

+ 39 - 0
BansheeEngine/Include/BsScriptCodeImportOptions.h

@@ -0,0 +1,39 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsImportOptions.h"
+#include "BsScriptCode.h"
+
+namespace BansheeEngine
+{
+	/**
+	 * @brief	Contains import options you may use to control how is a file containing
+	 *			script source code importer.
+	 */
+	class BS_EXPORT ScriptCodeImportOptions : public ImportOptions
+	{
+	public:
+		ScriptCodeImportOptions();
+
+		/**
+		* @brief	Sets whether the script is editor-only, or a normal game script.
+		*/
+		void setEditorScript(bool editorScript) { mEditorScript = editorScript; }
+
+		/**
+		 * @brief	Checks whether the script is editor-only, or a normal game script.
+		 */
+		bool isEditorScript() const { return mEditorScript; }
+
+		/************************************************************************/
+		/* 								SERIALIZATION                      		*/
+		/************************************************************************/
+	public:
+		friend class ScriptCodeImportOptionsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const;
+
+	private:
+		bool mEditorScript;
+	};
+}

+ 36 - 0
BansheeEngine/Include/BsScriptCodeImportOptionsRTTI.h

@@ -0,0 +1,36 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsScriptCodeImportOptions.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptCodeImportOptionsRTTI : public RTTIType <ScriptCodeImportOptions, ImportOptions, ScriptCodeImportOptionsRTTI>
+	{
+	private:
+		bool& getEditorScript(ScriptCodeImportOptions* obj) { return obj->mEditorScript; }
+		void setEditorScript(ScriptCodeImportOptions* obj, bool& val) { obj->mEditorScript = val; }
+	public:
+		ScriptCodeImportOptionsRTTI()
+		{
+			addPlainField("mEditorScript", 0, &ScriptCodeImportOptionsRTTI::getEditorScript, &ScriptCodeImportOptionsRTTI::setEditorScript);
+		}
+
+		virtual const String& getRTTIName()
+		{
+			static String name = "ScriptCodeImportOptions";
+			return name;
+		}
+
+		virtual UINT32 getRTTIId()
+		{
+			return TID_ScriptCodeImportOptions;
+		}
+
+		virtual std::shared_ptr<IReflectable> newRTTIObject()
+		{
+			return bs_shared_ptr<ScriptCodeImportOptions, PoolAlloc>();
+		}
+	};
+}

+ 3 - 0
BansheeEngine/Include/BsScriptCodeImporter.h

@@ -23,6 +23,9 @@ namespace BansheeEngine
 		/** @copydoc SpecificImporter::import */
 		virtual ResourcePtr import(const Path& filePath, ConstImportOptionsPtr importOptions);
 
+		/** @copydoc SpecificImporter::createImportOptions */
+		virtual ImportOptionsPtr createImportOptions() const;
+
 		static const WString DEFAULT_EXTENSION;
 	};
 }

+ 4 - 0
BansheeEngine/Include/BsScriptCodeRTTI.h

@@ -11,10 +11,14 @@ namespace BansheeEngine
 	private:
 		WString& getString(ScriptCode* obj) { return obj->mString; }
 		void setString(ScriptCode* obj, WString& val) { obj->mString = val; }
+
+		bool& getEditorScript(ScriptCode* obj) { return obj->mEditorScript; }
+		void setEditorScript(ScriptCode* obj, bool& val) { obj->mEditorScript = val; }
 	public:
 		ScriptCodeRTTI()
 		{
 			addPlainField("mString", 0, &ScriptCodeRTTI::getString, &ScriptCodeRTTI::setString);
+			addPlainField("mEditorScript", 1, &ScriptCodeRTTI::getEditorScript, &ScriptCodeRTTI::setEditorScript);
 		}
 
 		virtual const String& getRTTIName()

+ 24 - 5
BansheeEngine/Source/BsApplication.cpp

@@ -12,6 +12,7 @@
 #include "BsSceneObject.h"
 #include "BsCursor.h"
 #include "BsCoreThread.h"
+#include "BsFileSystem.h"
 
 namespace BansheeEngine
 {
@@ -42,11 +43,6 @@ namespace BansheeEngine
 		OverlayManager::startUp();
 
 		Cursor::startUp();
-
-#if BS_VER == BS_VER_DEV
-		loadPlugin("BansheeMono", &mMonoPlugin);
-		loadPlugin("SBansheeEngine", &mSBansheeEnginePlugin); // Scripting interface
-#endif
 	}
 
 	Application::~Application()
@@ -81,6 +77,11 @@ namespace BansheeEngine
 
 	void Application::onStartUp()
 	{
+#if BS_VER == BS_VER_DEV
+		loadPlugin("BansheeMono", &mMonoPlugin);
+		loadPlugin("SBansheeEngine", &mSBansheeEnginePlugin); // Scripting interface
+#endif
+
 		CoreApplication::onStartUp();
 
 		Cursor::instance().setCursor(CursorType::Arrow);
@@ -105,6 +106,24 @@ namespace BansheeEngine
 		return nullptr;
 	}
 
+	Path Application::getEngineAssemblyPath() const
+	{
+		Path assemblyPath = FileSystem::getWorkingDirectoryPath();
+		assemblyPath.append(ASSEMBLY_PATH);
+		assemblyPath.append(toWString(String(ENGINE_ASSEMBLY)) + L".dll");
+		
+		return assemblyPath;
+	}
+
+	Path Application::getGameAssemblyPath() const
+	{
+		Path assemblyPath = FileSystem::getWorkingDirectoryPath();
+		assemblyPath.append(ASSEMBLY_PATH);
+		assemblyPath.append(toWString(String(SCRIPT_GAME_ASSEMBLY)) + L".dll");
+
+		return assemblyPath;
+	}
+
 	const String& Application::getLibNameForRenderSystem(RenderSystemPlugin plugin)
 	{
 		static String DX11Name = "BansheeD3D11RenderSystem";

+ 0 - 1
BansheeEngine/Source/BsGUIManager.cpp

@@ -9,7 +9,6 @@
 #include "BsMeshData.h"
 #include "BsVertexDataDesc.h"
 #include "BsMesh.h"
-#include "BsUtil.h"
 #include "BsRenderWindowManager.h"
 #include "BsPlatform.h"
 #include "BsRect2I.h"

+ 0 - 1
BansheeEngine/Source/BsPlainTextImporter.cpp

@@ -1,6 +1,5 @@
 #include "BsPlainTextImporter.h"
 #include "BsPlainText.h"
-#include "BsPath.h"
 #include "BsDataStream.h"
 #include "BsFileSystem.h"
 

+ 6 - 6
BansheeEngine/Source/BsScriptCode.cpp

@@ -4,21 +4,21 @@
 
 namespace BansheeEngine
 {
-	ScriptCode::ScriptCode(const WString& data)
-		:Resource(false), mString(data)
+	ScriptCode::ScriptCode(const WString& data, bool editorScript)
+		:Resource(false), mString(data), mEditorScript(editorScript)
 	{
 
 	}
 
-	HScriptCode ScriptCode::create(const WString& data)
+	HScriptCode ScriptCode::create(const WString& data, bool editorScript)
 	{
-		return static_resource_cast<ScriptCode>(gResources()._createResourceHandle(_createPtr(data)));
+		return static_resource_cast<ScriptCode>(gResources()._createResourceHandle(_createPtr(data, editorScript)));
 	}
 
-	ScriptCodePtr ScriptCode::_createPtr(const WString& data)
+	ScriptCodePtr ScriptCode::_createPtr(const WString& data, bool editorScript)
 	{
 		ScriptCodePtr scriptCodePtr = bs_core_ptr<ScriptCode, PoolAlloc>(
-			new (bs_alloc<ScriptCode, PoolAlloc>()) ScriptCode(data));
+			new (bs_alloc<ScriptCode, PoolAlloc>()) ScriptCode(data, editorScript));
 		scriptCodePtr->_setThisPtr(scriptCodePtr);
 		scriptCodePtr->initialize();
 

+ 24 - 0
BansheeEngine/Source/BsScriptCodeImportOptions.cpp

@@ -0,0 +1,24 @@
+#include "BsScriptCodeImportOptions.h"
+#include "BsScriptCodeImportOptionsRTTI.h"
+
+namespace BansheeEngine
+{
+	ScriptCodeImportOptions::ScriptCodeImportOptions()
+		:mEditorScript(false)
+	{
+
+	}
+
+	/************************************************************************/
+	/* 								SERIALIZATION                      		*/
+	/************************************************************************/
+	RTTITypeBase* ScriptCodeImportOptions::getRTTIStatic()
+	{
+		return ScriptCodeImportOptionsRTTI::instance();
+	}
+
+	RTTITypeBase* ScriptCodeImportOptions::getRTTI() const
+	{
+		return ScriptCodeImportOptions::getRTTIStatic();
+	}
+}

+ 14 - 2
BansheeEngine/Source/BsScriptCodeImporter.cpp

@@ -1,8 +1,8 @@
 #include "BsScriptCodeImporter.h"
 #include "BsScriptCode.h"
-#include "BsPath.h"
 #include "BsDataStream.h"
 #include "BsFileSystem.h"
+#include "BsScriptCodeImportOptions.h"
 
 namespace BansheeEngine
 {
@@ -35,11 +35,23 @@ namespace BansheeEngine
 		DataStreamPtr stream = FileSystem::openFile(filePath);
 		WString textData = stream->getAsWString();
 
-		ScriptCodePtr scriptCode = ScriptCode::_createPtr(textData);
+		bool editorScript = false;
+		if (importOptions != nullptr)
+		{
+			SPtr<const ScriptCodeImportOptions> scriptIO = std::static_pointer_cast<const ScriptCodeImportOptions>(importOptions);
+			editorScript = scriptIO->isEditorScript();
+		}
+			
+		ScriptCodePtr scriptCode = ScriptCode::_createPtr(textData, editorScript);
 
 		WString fileName = filePath.getWFilename(false);
 		scriptCode->setName(fileName);
 
 		return scriptCode;
 	}
+
+	ImportOptionsPtr ScriptCodeImporter::createImportOptions() const
+	{
+		return bs_shared_ptr<ScriptCodeImportOptions>();
+	}
 }

+ 0 - 1
BansheeFBXImporter/Source/BsFBXImporter.cpp

@@ -3,7 +3,6 @@
 #include "BsCoreApplication.h"
 #include "BsDebug.h"
 #include "BsDataStream.h"
-#include "BsPath.h"
 #include "BsMeshData.h"
 #include "BsMesh.h"
 #include "BsVector2.h"

+ 0 - 1
BansheeFontImporter/Source/BsFontImporter.cpp

@@ -4,7 +4,6 @@
 #include "BsTexture.h"
 #include "BsResources.h"
 #include "BsDebug.h"
-#include "BsPath.h"
 #include "BsTexAtlasGenerator.h"
 #include "BsCoreApplication.h"
 #include "BsCoreThread.h"

+ 0 - 1
BansheeFreeImgImporter/Source/BsFreeImgImporter.cpp

@@ -2,7 +2,6 @@
 #include "BsResource.h"
 #include "BsDebug.h"
 #include "BsDataStream.h"
-#include "BsPath.h"
 #include "BsTextureManager.h"
 #include "BsTexture.h"
 #include "BsTextureImportOptions.h"

+ 0 - 1
BansheeGLRenderSystem/Source/BsGLVertexArrayObjectManager.cpp

@@ -3,7 +3,6 @@
 #include "BsVertexDeclaration.h"
 #include "BsGLSLGpuProgram.h"
 #include "BsGLHardwareBufferManager.h"
-#include "BsUtil.h"
 #include "BsRenderStats.h"
 
 #define VBO_BUFFER_OFFSET(i) ((char *)NULL + (i))

+ 0 - 7
BansheeGLRenderSystem/Source/GLSL/src/BsGLSLProgramPipelineManager.cpp

@@ -4,13 +4,6 @@
 
 namespace BansheeEngine
 {
-	template <class T>
-	inline void hash_combine(std::size_t& seed, const T& v)
-	{
-		std::hash<T> hasher;
-		seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
-	}
-
 	::std::size_t GLSLProgramPipelineManager::ProgramPipelineKeyHashFunction::operator()
 		(const GLSLProgramPipelineManager::ProgramPipelineKey &key) const
 	{

+ 0 - 1
BansheeMono/Source/BsMonoAssembly.cpp

@@ -1,7 +1,6 @@
 #include "BsMonoAssembly.h"
 #include "BsMonoClass.h"
 #include "BsMonoManager.h"
-#include "BsUtil.h"
 #include "BsMonoUtil.h"
 #include "BsException.h"
 

+ 0 - 1
BansheeMono/Source/BsMonoClass.cpp

@@ -4,7 +4,6 @@
 #include "BsMonoProperty.h"
 #include "BsMonoAssembly.h"
 #include "BsMonoManager.h"
-#include "BsUtil.h"
 #include "BsException.h"
 #include "BsMonoUtil.h"
 #include <mono/metadata/debug-helpers.h>

+ 0 - 3
BansheeUtility/Include/BsPath.h

@@ -1,8 +1,5 @@
 #pragma once
 
-#include "BsPrerequisitesUtil.h"
-#include "BsUtil.h"
-
 namespace BansheeEngine
 {
 	/**

+ 3 - 1
BansheeUtility/Include/BsPrerequisitesUtil.h

@@ -61,4 +61,6 @@
 #include "BsRTTIPrerequisites.h"
 
 #include "BsString.h"
-#include "BsMessageHandlerFwd.h"
+#include "BsMessageHandlerFwd.h"
+#include "BsUtil.h"
+#include "BsPath.h"

+ 12 - 2
BansheeUtility/Include/BsString.h

@@ -443,6 +443,11 @@ namespace BansheeEngine
 	 */
 	BS_UTILITY_EXPORT WString toWString(const String& source);
 
+	/**
+	 * @brief	Converts a narrow string to a wide string.
+	 */
+	BS_UTILITY_EXPORT WString toWString(const char* source);
+
 	/**
 	 * @brief	Converts a float to a string.
 	 */
@@ -584,10 +589,15 @@ namespace BansheeEngine
     BS_UTILITY_EXPORT WString toWString(const Vector<BansheeEngine::WString>& val);
 
 	/**
-	* @brief	Converts a wide string to a narrow string.
-	*/
+	 * @brief	Converts a wide string to a narrow string.
+	 */
 	BS_UTILITY_EXPORT String toString(const WString& source);
 
+	/**
+	 * @brief	Converts a wide string to a narrow string.
+	 */
+	BS_UTILITY_EXPORT String toString(const wchar_t* source);
+
 	/**
 	 * @brief	Converts a float to a string.
 	 */

+ 16 - 9
BansheeUtility/Include/BsStringFormat.h

@@ -51,7 +51,7 @@ namespace BansheeEngine
 
 			ParamData<T> parameters[MAX_PARAMS];
 			memset(parameters, 0, sizeof(parameters));
-			getParams<T>(parameters, 0, std::forward<Args>(args)...);
+			getParams(parameters, 0U, std::forward<Args>(args)...);
 
 			T bracketChars[MAX_IDENTIFIER_SIZE + 1];
 			UINT32 bracketWriteIdx = 0;
@@ -184,17 +184,17 @@ namespace BansheeEngine
 		/**
 		 * @brief	Helper method for converting any data type to a narrow string.
 		 */
-		template<class T> static std::string toString(const T&& param) { return std::to_string(param); }
+		template<class T> static std::string toString(const T& param) { return std::to_string(param); }
 
 		/**
 		 * @brief	Helper method that "converts" a narrow string to a narrow string (simply a pass through)
 		 */
-		template<> static std::string toString<std::string>(const std::string&& param) { return param; }
+		template<> static std::string toString<std::string>(const std::string& param) { return param; }
 
 		/**
 		 * @brief	Helper method that converts a Banshee narrow string to a standard narrow string.
 		 */
-		template<> static std::string toString<String>(const String&& param)
+		template<> static std::string toString<String>(const String& param)
 		{
 			return std::string(param.c_str());
 		}
@@ -202,17 +202,17 @@ namespace BansheeEngine
 		/**
 		 * @brief	Helper method for converting any data type to a wide string.
 		 */
-		template<class T> static std::wstring toWString(const T&& param) { return std::to_wstring(param); }
+		template<class T> static std::wstring toWString(const T& param) { return std::to_wstring(param); }
 
 		/**
 		 * @brief	Helper method that "converts" a wide string to a wide string (simply a pass through)
 		 */
-		template<> static std::wstring toWString<std::wstring>(const std::wstring&& param) { return param; }
+		template<> static std::wstring toWString<std::wstring>(const std::wstring& param) { return param; }
 
 		/**
 		 * @brief	Helper method that converts a Banshee wide string to a standard wide string.
 		 */
-		template<> static std::wstring toWString<WString>(const WString&& param)
+		template<> static std::wstring toWString<WString>(const WString& param)
 		{
 			return std::wstring(param.c_str());
 		}
@@ -258,8 +258,15 @@ namespace BansheeEngine
 		/**
 		 * @brief	Helper method for parameter size calculation. Used as a stopping point in template recursion.
 		 */
-		template<class T>
-		static void getParams(ParamData<T>* parameters, UINT32 idx)
+		static void getParams(ParamData<char>* parameters, UINT32 idx)
+		{
+			// Do nothing
+		}
+
+		/**
+		 * @brief	Helper method for parameter size calculation. Used as a stopping point in template recursion.
+		 */
+		static void getParams(ParamData<wchar_t>* parameters, UINT32 idx)
 		{
 			// Do nothing
 		}

+ 2 - 4
BansheeUtility/Include/BsUtil.h

@@ -1,7 +1,5 @@
 #pragma once
 
-#include "BsPrerequisitesUtil.h"
-
 namespace BansheeEngine
 {
 	/**
@@ -18,10 +16,10 @@ namespace BansheeEngine
 	/**
 	 * @brief	Generates an MD5 hash string for the provided source string.
 	 */
-	String md5(const WString& source);
+	String BS_UTILITY_EXPORT md5(const WString& source);
 
 	/**
 	 * @brief	Generates an MD5 hash string for the provided source string.
 	 */
-	String md5(const String& source);
+	String BS_UTILITY_EXPORT md5(const String& source);
 }

+ 2 - 2
BansheeUtility/Include/ThirdParty/md5.h

@@ -35,10 +35,11 @@ documentation and/or software.
 #ifndef BZF_MD5_H
 #define BZF_MD5_H
 
+#define _CRT_SECURE_NO_WARNINGS
+
 #include <cstring>
 #include <iostream>
 
-
 // a small class for calculating MD5 hashes of strings or byte arrays
 // it is not meant to be fast or secure
 //
@@ -61,7 +62,6 @@ public:
 	MD5& finalize();
 	std::string hexdigest() const;
 	void decdigest(unsigned char* buf, size_type length);
-	friend std::ostream& operator<<(std::ostream&, MD5 md5);
 
 private:
 	void init();

+ 0 - 1
BansheeUtility/Source/BsDebug.cpp

@@ -4,7 +4,6 @@
 #include "BsBitmapWriter.h"
 #include "BsFileSystem.h"
 #include "BsDataStream.h"
-#include "BsPath.h"
 
 #if BS_PLATFORM == BS_PLATFORM_WIN32 && BS_COMPILER == BS_COMPILER_MSVC
 #include <windows.h>

+ 0 - 1
BansheeUtility/Source/BsFileSerializer.cpp

@@ -3,7 +3,6 @@
 #include "BsException.h"
 #include "BsIReflectable.h"
 #include "BsBinarySerializer.h"
-#include "BsPath.h"
 #include "BsFileSystem.h"
 
 #include <numeric>

+ 1 - 1
BansheeUtility/Source/BsPath.cpp

@@ -1,4 +1,4 @@
-#include "BsPath.h"
+#include "BsPrerequisitesUtil.h"
 #include "BsException.h"
 
 namespace BansheeEngine

+ 10 - 0
BansheeUtility/Source/BsString.cpp

@@ -131,6 +131,11 @@ namespace BansheeEngine
 		return WString(source.begin(), source.end());
 	}
 
+	WString toWString(const char* source)
+	{
+		return toWString(String(source));
+	}
+
 	WString toWString(float val, unsigned short precision, 
 		unsigned short width, char fill, std::ios::fmtflags flags)
 	{
@@ -383,6 +388,11 @@ namespace BansheeEngine
 		return String(source.begin(), source.end());
 	}
 
+	String toString(const wchar_t* source)
+	{
+		return toString(WString(source));
+	}
+
 	String toString(float val, unsigned short precision, 
 		unsigned short width, char fill, std::ios::fmtflags flags)
 	{

+ 1 - 1
BansheeUtility/Source/BsUtil.cpp

@@ -1,4 +1,4 @@
-#include "BsUtil.h"
+#include "BsPrerequisitesUtil.h"
 #include "ThirdParty/md5.h"
 
 namespace BansheeEngine

+ 1 - 9
BansheeUtility/Source/ThirdParty/md5.cpp

@@ -37,7 +37,6 @@ documentation and/or software.
 #include <cstdio>
 #include <assert.h>
 
-
 // Constants for MD5Transform routine.
 #define S11 7
 #define S12 12
@@ -112,7 +111,7 @@ MD5::MD5()
 MD5::MD5(const std::string &text)
 {
 	init();
-	update(text.c_str(), text.length());
+	update(text.c_str(), (size_type)text.length());
 	finalize();
 }
 
@@ -356,13 +355,6 @@ void MD5::decdigest(unsigned char* buf, size_type length)
 
 //////////////////////////////
 
-std::ostream& operator<<(std::ostream& out, MD5 md5)
-{
-	return out << md5.hexdigest();
-}
-
-//////////////////////////////
-
 std::string md5(const std::string str)
 {
 	MD5 md5 = MD5(str);

+ 0 - 1
BansheeUtility/Source/Win32/BsFileSystem.cpp

@@ -1,7 +1,6 @@
 #include "BsFileSystem.h"
 #include "BsException.h"
 #include "BsDataStream.h"
-#include "BsPath.h"
 #include <windows.h>
 
 namespace BansheeEngine

+ 1 - 1
SBansheeEditor/Include/BsScriptBrowseDialog.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptBrowseDialog : public ScriptObject<ScriptBrowseDialog>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "BrowseDialog")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "BrowseDialog")
 
 	private:
 		static bool internal_OpenFile(MonoString* defaultFolder, MonoString* filterList, bool allowMultiselect, MonoArray** outPaths);

+ 3 - 4
SBansheeEditor/Include/BsScriptDragDropManager.h

@@ -3,7 +3,6 @@
 #include "BsScriptEditorPrerequisites.h"
 #include "BsScriptObject.h"
 #include "BsDragAndDropManager.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {
@@ -13,7 +12,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptDragDrop : public ScriptObject<ScriptDragDrop>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "DragDrop");
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DragDrop");
 
 	private:
 		ScriptDragDrop(MonoObject* instance);
@@ -31,7 +30,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptSceneObjectDragDropData : public ScriptObject<ScriptSceneObjectDragDropData>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "SceneObjectDragDropData");
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneObjectDragDropData");
 
 		static MonoObject* create(const Vector<HSceneObject>& sceneObjects);
 
@@ -49,7 +48,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptResourceDragDropData : public ScriptObject < ScriptResourceDragDropData >
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "ResourceDragDropData");
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ResourceDragDropData");
 
 		static MonoObject* create(const Vector<Path>& paths);
 

+ 0 - 2
SBansheeEditor/Include/BsScriptEditorPrerequisites.h

@@ -25,6 +25,4 @@ namespace BansheeEngine
 	class GUIGameObjectField;
 	class GUIResourceField;
 	class ScriptHandleSliderBase;
-
-	static const char* BansheeEditorAssemblyName = "MBansheeEditor";
 }

+ 1 - 1
SBansheeEditor/Include/BsScriptEditorSettings.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptEditorSettings : public ScriptObject < ScriptEditorSettings >
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "EditorSettings")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorSettings")
 
 	private:
 		ScriptEditorSettings(MonoObject* instance);

+ 1 - 1
SBansheeEditor/Include/BsScriptEditorUtility.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptEditorUtility : public ScriptObject <ScriptEditorUtility>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "EditorUtility")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorUtility")
 
 	private:
 		static void internal_CalculateBounds(MonoObject* so, AABox* bounds);

+ 1 - 1
SBansheeEditor/Include/BsScriptEditorWindow.h

@@ -17,7 +17,7 @@ namespace BansheeEngine
 			ScriptEditorWindow* nativeObj;
 		};
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "EditorWindow")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorWindow")
 
 		~ScriptEditorWindow();
 

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIColorField.h

@@ -9,7 +9,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIColorField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIComponentFoldout.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIComponentFoldout : public TScriptGUIElement<ScriptGUIComponentFoldout>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIComponentFoldout")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIComponentFoldout")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIFloatField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIFloatField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIFoldout.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIFoldout : public TScriptGUIElement<ScriptGUIFoldout>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIFoldout")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFoldout")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIGameObjectField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIGameObjectField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIIntField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIIntField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth, 

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIPanelContainer.h

@@ -10,7 +10,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIPanelContainer : public TScriptGUIElement<ScriptGUIPanelContainer>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIPanelContainer")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIPanelContainer")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* panel, MonoArray* guiOptions);

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIResourceField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIResourceField : public TScriptGUIElement<ScriptGUIResourceField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIResourceField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIResourceField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUITextField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUITextField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIToggleField.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIToggleField")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIVector2Field.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIVector2Field : public TScriptGUIElement<ScriptGUIVector2Field>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIVector2Field")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector2Field")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIVector3Field.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIVector3Field : public TScriptGUIElement<ScriptGUIVector3Field>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIVector3Field")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector3Field")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGUIVector4Field.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGUIVector4Field : public TScriptGUIElement<ScriptGUIVector4Field>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GUIVector4Field")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector4Field")
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,

+ 1 - 1
SBansheeEditor/Include/BsScriptGizmos.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGizmos : public ScriptObject<ScriptGizmos>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "Gizmos")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Gizmos")
 
 	private:
 		static void internal_SetColor(Color color);

+ 1 - 1
SBansheeEditor/Include/BsScriptHandleDrawing.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptHandleDrawing : public ScriptObject <ScriptHandleDrawing>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "HandleDrawing")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleDrawing")
 
 	private:
 		static void internal_SetColor(Color color);

+ 1 - 1
SBansheeEditor/Include/BsScriptHandleSlider.h

@@ -27,7 +27,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptHandleSlider : public ScriptObject <ScriptHandleSlider>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "HandleSlider")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSlider")
 
 	private:
 		static void internal_Destroy(ScriptHandleSliderBase* nativeInstance);

+ 1 - 1
SBansheeEditor/Include/BsScriptHandleSliderDisc.h

@@ -11,7 +11,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptHandleSliderDisc : public ScriptObject <ScriptHandleSliderDisc, ScriptHandleSliderBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "HandleSliderDisc")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderDisc")
 
 	protected:
 		virtual HandleSlider* getSlider() const { return mSlider; }

+ 1 - 1
SBansheeEditor/Include/BsScriptHandleSliderLine.h

@@ -11,7 +11,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptHandleSliderLine : public ScriptObject <ScriptHandleSliderLine, ScriptHandleSliderBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "HandleSliderLine")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderLine")
 
 	protected:
 		virtual HandleSlider* getSlider() const { return mSlider; }

+ 1 - 1
SBansheeEditor/Include/BsScriptHandleSliderPlane.h

@@ -11,7 +11,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptHandleSliderPlane : public ScriptObject <ScriptHandleSliderPlane, ScriptHandleSliderBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "HandleSliderPlane")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderPlane")
 
 	protected:
 		virtual HandleSlider* getSlider() const { return mSlider; }

+ 4 - 4
SBansheeEditor/Include/BsScriptImportOptions.h

@@ -22,7 +22,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptImportOptions : public ScriptObject <ScriptImportOptions, ScriptImportOptionsBase>
 	{
 	public:
-		static String getAssemblyName() { return BansheeEditorAssemblyName; }
+		static String getAssemblyName() { return EDITOR_ASSEMBLY; }
 		static String getNamespace() { return "BansheeEditor"; }
 		static String getTypeName() { return "ImportOptions"; }
 		static void initRuntimeData() { }
@@ -38,7 +38,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptTextureImportOptions : public ScriptObject<ScriptTextureImportOptions, ScriptImportOptionsBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "TextureImportOptions")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "TextureImportOptions")
 
 		static MonoObject* create();
 		static MonoObject* create(const SPtr<TextureImportOptions>& options);
@@ -60,7 +60,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptFontImportOptions : public ScriptObject <ScriptFontImportOptions, ScriptImportOptionsBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "FontImportOptions")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FontImportOptions")
 
 		static MonoObject* create();
 		static MonoObject* create(const SPtr<FontImportOptions>& options);
@@ -84,7 +84,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptGpuProgramImportOptions : public ScriptObject <ScriptGpuProgramImportOptions, ScriptImportOptionsBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "GpuProgramImportOptions")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GpuProgramImportOptions")
 
 		static MonoObject* create();
 		static MonoObject* create(const SPtr<GpuProgramImportOptions>& options);

+ 1 - 1
SBansheeEditor/Include/BsScriptModalWindow.h

@@ -17,7 +17,7 @@ namespace BansheeEngine
 			ManagedModalWindow* nativeObj;
 		};
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "ModalWindow")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ModalWindow")
 
 		~ScriptModalWindow();
 

+ 4 - 4
SBansheeEditor/Include/BsScriptProjectLibrary.h

@@ -10,7 +10,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptProjectLibrary : public ScriptObject<ScriptProjectLibrary>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "ProjectLibrary")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ProjectLibrary")
 
 		void static startUp();
 		void static shutDown();
@@ -58,7 +58,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptLibraryEntry : public ScriptObject <ScriptLibraryEntry>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "LibraryEntry")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "LibraryEntry")
 
 	private:
 		static MonoString* internal_GetPath(ScriptLibraryEntryBase* thisPtr);
@@ -70,7 +70,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptDirectoryEntry : public ScriptObject <ScriptDirectoryEntry, ScriptLibraryEntryBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "DirectoryEntry")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DirectoryEntry")
 
 		ScriptDirectoryEntry(MonoObject* instance, const Path& assetPath);
 
@@ -83,7 +83,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptFileEntry : public ScriptObject <ScriptFileEntry, ScriptLibraryEntryBase>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "FileEntry")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FileEntry")
 
 		ScriptFileEntry(MonoObject* instance, const Path& assetPath);
 

+ 1 - 1
SBansheeEditor/Include/BsScriptSceneViewHandler.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptSceneViewHandler : public ScriptObject < ScriptSceneViewHandler >
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "SceneViewHandler")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneViewHandler")
 
 	private:
 		static void internal_Create(MonoObject* managedInstance, ScriptEditorWindow* parentWindow, ScriptCameraHandler* camera);

+ 1 - 1
SBansheeEditor/Include/BsScriptSelection.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_SCR_BED_EXPORT ScriptSelection : public ScriptObject<ScriptSelection>
 	{
 	public:
-		SCRIPT_OBJ(BansheeEditorAssemblyName, "BansheeEditor", "Selection")
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Selection")
 
 	private:
 		static void internal_GetSceneObjectSelection(MonoArray** selection);

+ 6 - 5
SBansheeEditor/Source/BsEditorScriptManager.cpp

@@ -12,6 +12,7 @@
 #include "BsScriptProjectLibrary.h"
 #include "BsTime.h"
 #include "BsMath.h"
+#include "BsEditorApplication.h"
 
 namespace BansheeEngine
 {
@@ -22,7 +23,7 @@ namespace BansheeEngine
 		:mEditorAssembly(nullptr), mProgramEdClass(nullptr), mUpdateMethod(nullptr)
 	{
 		loadMonoTypes();
-		ScriptAssemblyManager::instance().loadAssemblyInfo(BansheeEditorAssemblyName);
+		ScriptAssemblyManager::instance().loadAssemblyInfo(EDITOR_ASSEMBLY);
 
 		ScriptHandleSliderManager::startUp();
 		ScriptGizmoManager::startUp(ScriptAssemblyManager::instance());
@@ -92,10 +93,10 @@ namespace BansheeEngine
 
 	void EditorScriptManager::loadMonoTypes()
 	{
-		const String ENGINE_ASSEMBLY_PATH = "..\\..\\Assemblies\\MBansheeEditor.dll";
-		const String ENGINE_ASSEMBLY_NAME = BansheeEditorAssemblyName;
-		
-		mEditorAssembly = &MonoManager::instance().loadAssembly(ENGINE_ASSEMBLY_PATH, ENGINE_ASSEMBLY_NAME);
+		const String editorAssemblyPath = gEditorApplication().getEditorAssemblyPath().toString();
+		mEditorAssembly = &MonoManager::instance().loadAssembly(editorAssemblyPath, EDITOR_ASSEMBLY);
+
+		// TODO - Load Editor script assembly (gEditorApplication.getEditorScriptAssemblyPath())
 
 		mProgramEdClass = mEditorAssembly->getClass("BansheeEditor", "Program");
 		mUpdateMethod = mProgramEdClass->getMethod("EditorUpdate");

+ 0 - 1
SBansheeEditor/Source/BsScriptBrowseDialog.cpp

@@ -3,7 +3,6 @@
 #include "BsMonoClass.h"
 #include "BsPlatform.h"
 #include "BsMonoUtil.h"
-#include "BsPath.h"
 
 namespace BansheeEngine
 {

+ 2 - 2
SBansheeEditor/Source/BsScriptEditorWindow.cpp

@@ -235,7 +235,7 @@ namespace BansheeEngine
 
 	void ScriptEditorWindow::registerManagedEditorWindows()
 	{
-		MonoAssembly* assembly = MonoManager::instance().getAssembly(BansheeEditorAssemblyName);
+		MonoAssembly* assembly = MonoManager::instance().getAssembly(EDITOR_ASSEMBLY);
 
 		if(assembly != nullptr)
 		{
@@ -321,7 +321,7 @@ namespace BansheeEngine
 
 	bool ScriptEditorWidget::createManagedInstance()
 	{
-		MonoAssembly* assembly = MonoManager::instance().getAssembly(BansheeEditorAssemblyName);
+		MonoAssembly* assembly = MonoManager::instance().getAssembly(EDITOR_ASSEMBLY);
 
 		if (assembly != nullptr)
 		{

+ 1 - 1
SBansheeEditor/Source/BsScriptGizmoManager.cpp

@@ -105,7 +105,7 @@ namespace BansheeEngine
 	void ScriptGizmoManager::reloadAssemblyData()
 	{
 		// Reload DrawGizmo attribute from editor assembly
-		MonoAssembly* editorAssembly = MonoManager::instance().getAssembly(BansheeEditorAssemblyName);
+		MonoAssembly* editorAssembly = MonoManager::instance().getAssembly(EDITOR_ASSEMBLY);
 		mDrawGizmoAttribute = editorAssembly->getClass("BansheeEditor", "DrawGizmo");
 		if (mDrawGizmoAttribute == nullptr)
 			BS_EXCEPT(InvalidStateException, "Cannot find DrawGizmo managed class.");

Some files were not shown because too many files changed in this diff