Просмотр исходного кода

More work on improving documentation for doxygen generation

BearishSun 9 лет назад
Родитель
Сommit
a993962372
72 измененных файлов с 5552 добавлено и 5698 удалено
  1. 93 93
      Source/BansheeCore/Include/BsCoreSceneManager.h
  2. 164 164
      Source/BansheeCore/Include/BsGpuParamBlockBuffer.h
  3. 162 162
      Source/BansheeCore/Include/BsImporter.h
  4. 657 657
      Source/BansheeCore/Include/BsSceneObject.h
  5. 98 98
      Source/BansheeEditor/Include/BsEditorWidgetManager.h
  6. 1 1
      Source/BansheeEditor/Source/Win32/BsVSCodeEditor.cpp
  7. 22 20
      Source/SBansheeEditor/Include/BsEditorResourceLoader.h
  8. 35 36
      Source/SBansheeEditor/Include/BsEditorScriptLibrary.h
  9. 57 60
      Source/SBansheeEditor/Include/BsEditorScriptManager.h
  10. 213 239
      Source/SBansheeEditor/Include/BsGUIGameObjectField.h
  11. 224 256
      Source/SBansheeEditor/Include/BsGUIResourceField.h
  12. 202 236
      Source/SBansheeEditor/Include/BsGUITextureField.h
  13. 62 64
      Source/SBansheeEditor/Include/BsMenuItemManager.h
  14. 31 26
      Source/SBansheeEditor/Include/BsScriptBrowseDialog.h
  15. 55 53
      Source/SBansheeEditor/Include/BsScriptBuildManager.h
  16. 33 29
      Source/SBansheeEditor/Include/BsScriptCodeEditor.h
  17. 166 176
      Source/SBansheeEditor/Include/BsScriptDragDropManager.h
  18. 108 122
      Source/SBansheeEditor/Include/BsScriptDropDownWindow.h
  19. 84 88
      Source/SBansheeEditor/Include/BsScriptEditorApplication.h
  20. 40 36
      Source/SBansheeEditor/Include/BsScriptEditorBuiltin.h
  21. 76 90
      Source/SBansheeEditor/Include/BsScriptEditorInput.h
  22. 46 31
      Source/SBansheeEditor/Include/BsScriptEditorPrerequisites.h
  23. 72 68
      Source/SBansheeEditor/Include/BsScriptEditorSettings.h
  24. 25 23
      Source/SBansheeEditor/Include/BsScriptEditorTestSuite.h
  25. 31 27
      Source/SBansheeEditor/Include/BsScriptEditorUtility.h
  26. 68 68
      Source/SBansheeEditor/Include/BsScriptEditorVirtualInput.h
  27. 48 77
      Source/SBansheeEditor/Include/BsScriptEditorWindow.h
  28. 87 99
      Source/SBansheeEditor/Include/BsScriptFolderMonitor.h
  29. 46 42
      Source/SBansheeEditor/Include/BsScriptGUIColorField.h
  30. 56 50
      Source/SBansheeEditor/Include/BsScriptGUIEnumField.h
  31. 57 53
      Source/SBansheeEditor/Include/BsScriptGUIFloatField.h
  32. 49 49
      Source/SBansheeEditor/Include/BsScriptGUIGameObjectField.h
  33. 57 53
      Source/SBansheeEditor/Include/BsScriptGUIIntField.h
  34. 51 47
      Source/SBansheeEditor/Include/BsScriptGUIListBoxField.h
  35. 51 50
      Source/SBansheeEditor/Include/BsScriptGUIResourceField.h
  36. 6 0
      Source/SBansheeEditor/Include/BsScriptGUISceneTreeView.h
  37. 48 44
      Source/SBansheeEditor/Include/BsScriptGUISliderField.h
  38. 56 52
      Source/SBansheeEditor/Include/BsScriptGUITextField.h
  39. 52 51
      Source/SBansheeEditor/Include/BsScriptGUITextureField.h
  40. 46 42
      Source/SBansheeEditor/Include/BsScriptGUIToggleField.h
  41. 11 7
      Source/SBansheeEditor/Include/BsScriptGUIVector2Field.h
  42. 11 7
      Source/SBansheeEditor/Include/BsScriptGUIVector3Field.h
  43. 11 7
      Source/SBansheeEditor/Include/BsScriptGUIVector4Field.h
  44. 69 71
      Source/SBansheeEditor/Include/BsScriptGizmoManager.h
  45. 6 2
      Source/SBansheeEditor/Include/BsScriptGizmos.h
  46. 46 42
      Source/SBansheeEditor/Include/BsScriptHandleDrawing.h
  47. 138 147
      Source/SBansheeEditor/Include/BsScriptHandleManager.h
  48. 67 67
      Source/SBansheeEditor/Include/BsScriptHandleSlider.h
  49. 45 45
      Source/SBansheeEditor/Include/BsScriptHandleSliderDisc.h
  50. 43 43
      Source/SBansheeEditor/Include/BsScriptHandleSliderLine.h
  51. 30 30
      Source/SBansheeEditor/Include/BsScriptHandleSliderManager.h
  52. 45 45
      Source/SBansheeEditor/Include/BsScriptHandleSliderPlane.h
  53. 184 225
      Source/SBansheeEditor/Include/BsScriptImportOptions.h
  54. 53 53
      Source/SBansheeEditor/Include/BsScriptInspectorUtility.h
  55. 145 158
      Source/SBansheeEditor/Include/BsScriptModalWindow.h
  56. 137 146
      Source/SBansheeEditor/Include/BsScriptOSDropTarget.h
  57. 80 91
      Source/SBansheeEditor/Include/BsScriptPlatformInfo.h
  58. 33 29
      Source/SBansheeEditor/Include/BsScriptPrefabUtility.h
  59. 177 189
      Source/SBansheeEditor/Include/BsScriptProjectLibrary.h
  60. 47 43
      Source/SBansheeEditor/Include/BsScriptProjectSettings.h
  61. 33 27
      Source/SBansheeEditor/Include/BsScriptSceneGizmos.h
  62. 34 28
      Source/SBansheeEditor/Include/BsScriptSceneGrid.h
  63. 51 45
      Source/SBansheeEditor/Include/BsScriptSceneHandles.h
  64. 35 29
      Source/SBansheeEditor/Include/BsScriptSceneSelection.h
  65. 73 77
      Source/SBansheeEditor/Include/BsScriptSelection.h
  66. 43 39
      Source/SBansheeEditor/Include/BsScriptUndoRedo.h
  67. 36 34
      Source/SBansheeEditor/Include/BsScriptUnitTests.h
  68. 68 68
      Source/SBansheeEditor/Include/BsToolbarItemManager.h
  69. 1 1
      Source/SBansheeEngine/Include/BsScriptEnginePrerequisites.h
  70. 1 3
      Source/SBansheeEngine/Include/BsScriptTexture3D.h
  71. 102 104
      Source/SBansheeEngine/Source/BsScriptDebug.cpp
  72. 162 164
      Source/SBansheeEngine/Source/BsScriptShader.cpp

+ 93 - 93
Source/BansheeCore/Include/BsCoreSceneManager.h

@@ -1,94 +1,94 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-#include "BsGameObject.h"
-
-namespace BansheeEngine
-{
-	/** @cond INTERNAL */
-	/** @addtogroup Scene
-	 *  @{
-	 */
-
-	/**
-	 * Manages all objects in the scene and provides various query methods for finding objects. This is just the base class
-	 * with basic query functionality. You should override it with your own version.
-	 */
-	class BS_CORE_EXPORT CoreSceneManager : public Module<CoreSceneManager>
-	{
-	public:
-		CoreSceneManager();
-		virtual ~CoreSceneManager();
-
-		/**	Returns the root scene object. */
-		HSceneObject getRootNode() const { return mRootNode; }
-
-		/**
-		 * Destroys all scene objects in the scene.
-		 *
-		 * @param[in]	forceAll	If true, then even the persistent objects will be unloaded.
-		 */
-		void clearScene(bool forceAll = false);
-
-		/** Changes the root scene object. Any persistent objects will remain in the scene, now parented to the new root. */
-		void _setRootNode(const HSceneObject& root);
-
-		/** Called every frame. Calls update methods on all scene objects and their components. */
-		virtual void _update();
-
-		/** Updates dirty transforms on any core objects that may be tied with scene objects. */
-		virtual void _updateCoreObjectTransforms() { }
-
-	protected:
-		friend class SceneObject;
-
-		/**
-		 * Register a new node in the scene manager, on the top-most level of the hierarchy.
-		 * 			
-		 * @param [in]	node	Node you wish to add. It's your responsibility not to add duplicate or null nodes. This 
-		 *						method won't check.
-		 *
-		 * @note	
-		 * After you add a node in the scene manager, it takes ownership of its memory and is responsible for releasing it.
-		 * Do NOT add nodes that have already been added (i.e. if you just want to change their parent). Normally this 
-		 * method will only be called by SceneObject.
-		 */
-		void registerNewSO(const HSceneObject& node);
-
-	protected:
-		HSceneObject mRootNode;
-	};
-
-	/**
-	 * Handles creation of a scene manager.
-	 *
-	 * @note	
-	 * Since scene manager implementations may vary it is expected that a concrete implementation of a scene manager will 
-	 * register its creation method using setFactoryMethod() which will then later be used for creating the scene manager
-	 * during application start up.
-	 */
-	class BS_CORE_EXPORT SceneManagerFactory
-	{
-	public:
-		/**	Creates a concrete scene manager, depending on the currently set factory method. */
-		static void create();
-
-		/**	Sets method that will be used for creating the scene manager when create() gets called. */
-		static void setFactoryMethod(const std::function<void()>& method)
-		{
-			mFactoryMethod = method;
-		}
-
-	private:
-		static std::function<void()> mFactoryMethod;
-	};
-
-	/**	Provides easy access to the CoreSceneManager. */
-	BS_CORE_EXPORT CoreSceneManager& gCoreSceneManager();
-
-	/** @} */
-	/** @endcond */
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+#include "BsGameObject.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**
+	 * Manages all objects in the scene and provides various query methods for finding objects. This is just the base class
+	 * with basic query functionality. You should override it with your own version.
+	 */
+	class BS_CORE_EXPORT CoreSceneManager : public Module<CoreSceneManager>
+	{
+	public:
+		CoreSceneManager();
+		virtual ~CoreSceneManager();
+
+		/**	Returns the root scene object. */
+		HSceneObject getRootNode() const { return mRootNode; }
+
+		/**
+		 * Destroys all scene objects in the scene.
+		 *
+		 * @param[in]	forceAll	If true, then even the persistent objects will be unloaded.
+		 */
+		void clearScene(bool forceAll = false);
+
+		/** Changes the root scene object. Any persistent objects will remain in the scene, now parented to the new root. */
+		void _setRootNode(const HSceneObject& root);
+
+		/** Called every frame. Calls update methods on all scene objects and their components. */
+		virtual void _update();
+
+		/** Updates dirty transforms on any core objects that may be tied with scene objects. */
+		virtual void _updateCoreObjectTransforms() { }
+
+	protected:
+		friend class SceneObject;
+
+		/**
+		 * Register a new node in the scene manager, on the top-most level of the hierarchy.
+		 * 			
+		 * @param[in]	node	Node you wish to add. It's your responsibility not to add duplicate or null nodes. This 
+		 *						method won't check.
+		 *
+		 * @note	
+		 * After you add a node in the scene manager, it takes ownership of its memory and is responsible for releasing it.
+		 * Do NOT add nodes that have already been added (i.e. if you just want to change their parent). Normally this 
+		 * method will only be called by SceneObject.
+		 */
+		void registerNewSO(const HSceneObject& node);
+
+	protected:
+		HSceneObject mRootNode;
+	};
+
+	/**
+	 * Handles creation of a scene manager.
+	 *
+	 * @note	
+	 * Since scene manager implementations may vary it is expected that a concrete implementation of a scene manager will 
+	 * register its creation method using setFactoryMethod() which will then later be used for creating the scene manager
+	 * during application start up.
+	 */
+	class BS_CORE_EXPORT SceneManagerFactory
+	{
+	public:
+		/**	Creates a concrete scene manager, depending on the currently set factory method. */
+		static void create();
+
+		/**	Sets method that will be used for creating the scene manager when create() gets called. */
+		static void setFactoryMethod(const std::function<void()>& method)
+		{
+			mFactoryMethod = method;
+		}
+
+	private:
+		static std::function<void()> mFactoryMethod;
+	};
+
+	/**	Provides easy access to the CoreSceneManager. */
+	BS_CORE_EXPORT CoreSceneManager& gCoreSceneManager();
+
+	/** @} */
+	/** @endcond */
 }

+ 164 - 164
Source/BansheeCore/Include/BsGpuParamBlockBuffer.h

@@ -1,165 +1,165 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsCoreObject.h"
-
-namespace BansheeEngine
-{
-	/** @addtogroup RenderAPI
-	 *  @{
-	 */
-
-	 /** @cond INTERNAL */
-
-	/**
-	 * Core thread version of a GpuParamBlockBuffer.
-	 *
-	 * @note	Core thread only.
-	 */
-	class BS_CORE_EXPORT GpuParamBlockBufferCore : public CoreObjectCore
-	{
-	public:
-		GpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage);
-		virtual ~GpuParamBlockBufferCore();
-
-		/** Writes all of the specified data to the buffer. Data size must be the same size as the buffer. */
-		virtual void writeToGPU(const UINT8* data) = 0;
-
-		/**
-		 * Copies data from the internal buffer to a pre-allocated array. Be aware this generally isn't a very fast 
-		 * operation as reading from the GPU will most definitely involve a CPU-GPU sync point.
-		 *
-		 * @param [in,out]	data	Array where the data will be written to. Must be of getSize() bytes.
-		 */
-		virtual void readFromGPU(UINT8* data) const = 0;
-
-		/** Flushes any cached data into the actual GPU buffer. */
-		void flushToGPU();
-
-		/**
-		 * Write some data to the specified offset in the buffer. 
-		 *
-		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
-		 */
-		void write(UINT32 offset, const void* data, UINT32 size);
-
-		/**
-		 * Read some data from the specified offset in the buffer.
-		 *			
-		 * @note	All values are in bytes. This reads from the cached CPU buffer and not directly from the GPU.
-		 */
-		void read(UINT32 offset, void* data, UINT32 size);
-
-		/**
-		 * Clear specified section of the buffer to zero.
-		 *
-		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
-		 */
-		void zeroOut(UINT32 offset, UINT32 size);
-
-		/**	Returns the size of the buffer in bytes. */
-		UINT32 getSize() const { return mSize; }
-
-		/** @copydoc HardwareBufferCoreManager::createGpuParamBlockBuffer */
-		static SPtr<GpuParamBlockBufferCore> create(UINT32 size, GpuParamBlockUsage usage = GPBU_DYNAMIC);
-
-	protected:
-		/** @copydoc CoreObjectCore::syncToCore */
-		virtual void syncToCore(const CoreSyncData& data)  override;
-
-		GpuParamBlockUsage mUsage;
-		UINT32 mSize;
-
-		UINT8* mCachedData;
-		bool mGPUBufferDirty;
-	};
-
-	/**
-	 * Implementation of a GpuParamBlock buffer that doesn't use a GPU buffer for storage. Used with APIs that do not 
-	 * support GPU parameter buffers.
-	 */
-	class BS_CORE_EXPORT GenericGpuParamBlockBufferCore : public GpuParamBlockBufferCore
-	{
-	public:
-		GenericGpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage);
-		~GenericGpuParamBlockBufferCore();
-
-		/** @copydoc GpuParamBlockBufferCore::writeData */
-		void writeToGPU(const UINT8* data) override;
-
-		/** @copydoc GpuParamBlockBufferCore::readData */
-		void readFromGPU(UINT8* data) const override;
-
-	protected:
-		UINT8* mData;
-
-		/** @copydoc CoreObjectCore::initialize */
-		virtual void initialize() override;
-	};
-
-	/** @endcond */
-
-	/**
-	 * Represents a GPU parameter block buffer. Parameter block buffers are bound to GPU programs which then fetch 
-	 * parameters from those buffers.
-	 *
-	 * Writing or reading from this buffer will translate directly to API calls that update the GPU.
-	 * 			
-	 * @note	Sim thread only.
-	 */
-	class BS_CORE_EXPORT GpuParamBlockBuffer : public CoreObject
-	{
-	public:
-		GpuParamBlockBuffer(UINT32 size, GpuParamBlockUsage usage);
-		virtual ~GpuParamBlockBuffer();
-
-		/**
-		 * Write some data to the specified offset in the buffer. 
-		 *
-		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
-		 */
-		void write(UINT32 offset, const void* data, UINT32 size);
-
-		/**
-		 * Read some data from the specified offset in the buffer.
-		 *			
-		 * @note	All values are in bytes. This reads from the cached CPU buffer and not from the GPU.
-		 */
-		void read(UINT32 offset, void* data, UINT32 size);
-
-		/**
-		 * Clear specified section of the buffer to zero.
-		 *
-		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
-		 */
-		void zeroOut(UINT32 offset, UINT32 size);
-
-		/** Returns internal cached data of the buffer. */
-		const UINT8* getCachedData() const { return mCachedData; }
-
-		/**	Returns the size of the buffer in bytes. */
-		UINT32 getSize() const { return mSize; }
-
-		/**	Retrieves a core implementation of a GPU param block buffer usable only from the core thread. */
-		SPtr<GpuParamBlockBufferCore> getCore() const;
-
-		/** @copydoc HardwareBufferManager::createGpuParamBlockBuffer */
-		static GpuParamBlockBufferPtr create(UINT32 size, GpuParamBlockUsage usage = GPBU_DYNAMIC);
-
-	protected:
-		/** @copydoc CoreObject::createCore */
-		SPtr<CoreObjectCore> createCore() const override;
-
-		/** @copydoc CoreObject::syncToCore */
-		virtual CoreSyncData syncToCore(FrameAlloc* allocator) override;
-
-		GpuParamBlockUsage mUsage;
-		UINT32 mSize;
-		UINT8* mCachedData;
-	};
-
-	/** @endcond */
-	/** @} */
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsCoreObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup RenderAPI
+	 *  @{
+	 */
+
+	 /** @cond INTERNAL */
+
+	/**
+	 * Core thread version of a GpuParamBlockBuffer.
+	 *
+	 * @note	Core thread only.
+	 */
+	class BS_CORE_EXPORT GpuParamBlockBufferCore : public CoreObjectCore
+	{
+	public:
+		GpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage);
+		virtual ~GpuParamBlockBufferCore();
+
+		/** Writes all of the specified data to the buffer. Data size must be the same size as the buffer. */
+		virtual void writeToGPU(const UINT8* data) = 0;
+
+		/**
+		 * Copies data from the internal buffer to a pre-allocated array. Be aware this generally isn't a very fast 
+		 * operation as reading from the GPU will most definitely involve a CPU-GPU sync point.
+		 *
+		 * @param[in,out]	data	Array where the data will be written to. Must be of getSize() bytes.
+		 */
+		virtual void readFromGPU(UINT8* data) const = 0;
+
+		/** Flushes any cached data into the actual GPU buffer. */
+		void flushToGPU();
+
+		/**
+		 * Write some data to the specified offset in the buffer. 
+		 *
+		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
+		 */
+		void write(UINT32 offset, const void* data, UINT32 size);
+
+		/**
+		 * Read some data from the specified offset in the buffer.
+		 *			
+		 * @note	All values are in bytes. This reads from the cached CPU buffer and not directly from the GPU.
+		 */
+		void read(UINT32 offset, void* data, UINT32 size);
+
+		/**
+		 * Clear specified section of the buffer to zero.
+		 *
+		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
+		 */
+		void zeroOut(UINT32 offset, UINT32 size);
+
+		/**	Returns the size of the buffer in bytes. */
+		UINT32 getSize() const { return mSize; }
+
+		/** @copydoc HardwareBufferCoreManager::createGpuParamBlockBuffer */
+		static SPtr<GpuParamBlockBufferCore> create(UINT32 size, GpuParamBlockUsage usage = GPBU_DYNAMIC);
+
+	protected:
+		/** @copydoc CoreObjectCore::syncToCore */
+		virtual void syncToCore(const CoreSyncData& data)  override;
+
+		GpuParamBlockUsage mUsage;
+		UINT32 mSize;
+
+		UINT8* mCachedData;
+		bool mGPUBufferDirty;
+	};
+
+	/**
+	 * Implementation of a GpuParamBlock buffer that doesn't use a GPU buffer for storage. Used with APIs that do not 
+	 * support GPU parameter buffers.
+	 */
+	class BS_CORE_EXPORT GenericGpuParamBlockBufferCore : public GpuParamBlockBufferCore
+	{
+	public:
+		GenericGpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage);
+		~GenericGpuParamBlockBufferCore();
+
+		/** @copydoc GpuParamBlockBufferCore::writeData */
+		void writeToGPU(const UINT8* data) override;
+
+		/** @copydoc GpuParamBlockBufferCore::readData */
+		void readFromGPU(UINT8* data) const override;
+
+	protected:
+		UINT8* mData;
+
+		/** @copydoc CoreObjectCore::initialize */
+		virtual void initialize() override;
+	};
+
+	/** @endcond */
+
+	/**
+	 * Represents a GPU parameter block buffer. Parameter block buffers are bound to GPU programs which then fetch 
+	 * parameters from those buffers.
+	 *
+	 * Writing or reading from this buffer will translate directly to API calls that update the GPU.
+	 * 			
+	 * @note	Sim thread only.
+	 */
+	class BS_CORE_EXPORT GpuParamBlockBuffer : public CoreObject
+	{
+	public:
+		GpuParamBlockBuffer(UINT32 size, GpuParamBlockUsage usage);
+		virtual ~GpuParamBlockBuffer();
+
+		/**
+		 * Write some data to the specified offset in the buffer. 
+		 *
+		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
+		 */
+		void write(UINT32 offset, const void* data, UINT32 size);
+
+		/**
+		 * Read some data from the specified offset in the buffer.
+		 *			
+		 * @note	All values are in bytes. This reads from the cached CPU buffer and not from the GPU.
+		 */
+		void read(UINT32 offset, void* data, UINT32 size);
+
+		/**
+		 * Clear specified section of the buffer to zero.
+		 *
+		 * @note	All values are in bytes. Actual hardware buffer update is delayed until rendering.
+		 */
+		void zeroOut(UINT32 offset, UINT32 size);
+
+		/** Returns internal cached data of the buffer. */
+		const UINT8* getCachedData() const { return mCachedData; }
+
+		/**	Returns the size of the buffer in bytes. */
+		UINT32 getSize() const { return mSize; }
+
+		/**	Retrieves a core implementation of a GPU param block buffer usable only from the core thread. */
+		SPtr<GpuParamBlockBufferCore> getCore() const;
+
+		/** @copydoc HardwareBufferManager::createGpuParamBlockBuffer */
+		static GpuParamBlockBufferPtr create(UINT32 size, GpuParamBlockUsage usage = GPBU_DYNAMIC);
+
+	protected:
+		/** @copydoc CoreObject::createCore */
+		SPtr<CoreObjectCore> createCore() const override;
+
+		/** @copydoc CoreObject::syncToCore */
+		virtual CoreSyncData syncToCore(FrameAlloc* allocator) override;
+
+		GpuParamBlockUsage mUsage;
+		UINT32 mSize;
+		UINT8* mCachedData;
+	};
+
+	/** @endcond */
+	/** @} */
 }

+ 162 - 162
Source/BansheeCore/Include/BsImporter.h

@@ -1,163 +1,163 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-#include "BsSpecificImporter.h"
-
-namespace BansheeEngine
-{
-	/** @addtogroup Importer
-	 *  @{
-	 */
-
-	/** 
-	 * Contains a resource that was imported from a file that contains multiple resources (e.g. an animation from an FBX 
-	 * file). 
-	 */
-	struct SubResource
-	{
-		WString name; /**< Unique name of the sub-resource. */
-		HResource value; /**< Contents of the sub-resource. */
-	};
-
-	/** Module responsible for importing various asset types and converting them to types usable by the engine. */
-	class BS_CORE_EXPORT Importer : public Module<Importer>
-	{
-	public:
-		Importer(); 
-		~Importer(); 
-
-		/**
-		 * Imports a resource at the specified location, and returns the loaded data. If file contains more than one
-		 * resource only the primary resource is imported (e.g. for an FBX a mesh would be imported, but animations ignored).
-		 *
-		 * @param[in]	inputFilePath	Pathname of the input file.
-		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
-		 *								actually match the type of the importer used for the file type.
-		 * @return						Imported resource.
-		 *
-		 * @see		createImportOptions
-		 */
-		HResource import(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
-
-		/** @copydoc import */
-		template <class T>
-		ResourceHandle<T> import(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr)
-		{
-			return static_resource_cast<T>(import(inputFilePath, importOptions));
-		}
-
-		/**
-		 * Imports a resource at the specified location, and returns the loaded data. This method returns all imported
-		 * resources, which is relevant for files that can contain multiple resources (e.g. an FBX which may contain both
-		 * a mesh and animations). 
-		 *
-		 * @param[in]	inputFilePath	Pathname of the input file.
-		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
-		 *								actually match the type of the importer used for the file type.
-		 * @return						A list of all imported resources. The primary resource is always the first returned
-		 *								resource.
-		 *
-		 * @see		createImportOptions
-		 */
-		Vector<SubResource> importAll(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
-
-		/**
-		 * Imports a resource and replaces the contents of the provided existing resource with new imported data.
-		 *
-		 * @param[in]	inputFilePath	Pathname of the input file.
-		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
-		 *								actually match the type of the importer used for the file type. 
-		 *
-		 * @see		createImportOptions
-		 */
-		void reimport(HResource& existingResource, const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
-
-		/**
-		 * Automatically detects the importer needed for the provided file and returns valid type of import options for 
-		 * that importer.
-		 *
-		 * @param[in]	inputFilePath	Pathname of the input file.
-		 *
-		 * @return						The new import options. Null is returned if the file path is not valid, or if a 
-		 *								valid importer cannot be found for the specified file.
-		 * 			
-		 * @note	
-		 * You will need to type cast the importer options to a valid type, taking into consideration exact importer you 
-		 * expect to be used for this file type. If you don't use a proper import options type, an exception will be thrown 
-		 * during import.
-		 */
-		ImportOptionsPtr createImportOptions(const Path& inputFilePath);
-
-		/** @copydoc createImportOptions */
-		template<class T>
-		SPtr<T> createImportOptions(const Path& inputFilePath)
-		{
-			return std::static_pointer_cast<T>(createImportOptions(inputFilePath));
-		}
-
-		/**
-		 * Checks if we can import a file with the specified extension.
-		 *
-		 * @param[in]	extension	The extension without the leading dot.
-		 */
-		bool supportsFileType(const WString& extension) const;
-
-		/**
-		 * Checks if we can import a file with the specified magic number.
-		 *
-		 * @param[in]	magicNumber 	The buffer containing the magic number.
-		 * @param[in]	magicNumSize	Size of the magic number buffer.
-		 */
-		bool supportsFileType(const UINT8* magicNumber, UINT32 magicNumSize) const;
-
-		/** @cond INTERNAL */
-
-		/**
-		 * Adds a new asset importer for the specified file extension. If an asset importer for that extension already 
-		 * exists, it is removed and replaced with the current one.
-		 *
-		 *
-		 * @param [in]	importer	The importer that is able to handle files with the specified extension. nullptr if you
-		 * 							want to remove an asset importer for the extension.
-		 *
-		 * @note	Internal method. 
-		 * @note	This method should only be called by asset importers themselves on startup. Importer takes ownership
-		 *			of the provided pointer and will release it. Assumes it is allocated using the general allocator.
-		 */
-		void _registerAssetImporter(SpecificImporter* importer);
-
-		/**
-		 * Imports a resource at the specified location but doesn't create resource handles. This method returns all 
-		 * imported resources, which is relevant for files that can contain multiple resources (e.g. an FBX which may
-		 * contain both a mesh and animations). 
-		 *
-		 * @param[in]	inputFilePath	Pathname of the input file.
-		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
-		 *								actually match the type of the importer used for the file type.
-		 * @return						A list of all imported resources. The primary resource is always the first returned
-		 *								resource. Caller is responsible for creating resource handles for the returned 
-		 *								values.
-		 *
-		 * @see		createImportOptions
-		 */
-		Vector<SubResourceRaw> _importAllRaw(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
-
-		/** @endcond */
-	private:
-		/** 
-		 * Searches available importers and attempts to find one that can import the file of the provided type. Returns null
-		 * if one cannot be found.
-		 */
-		SpecificImporter* getImporterForFile(const Path& inputFilePath) const;
-
-		Vector<SpecificImporter*> mAssetImporters;
-	};
-
-	/** Provides easier access to Importer. */
-	BS_CORE_EXPORT Importer& gImporter();
-
-	/** @} */
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+#include "BsSpecificImporter.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Importer
+	 *  @{
+	 */
+
+	/** 
+	 * Contains a resource that was imported from a file that contains multiple resources (e.g. an animation from an FBX 
+	 * file). 
+	 */
+	struct SubResource
+	{
+		WString name; /**< Unique name of the sub-resource. */
+		HResource value; /**< Contents of the sub-resource. */
+	};
+
+	/** Module responsible for importing various asset types and converting them to types usable by the engine. */
+	class BS_CORE_EXPORT Importer : public Module<Importer>
+	{
+	public:
+		Importer(); 
+		~Importer(); 
+
+		/**
+		 * Imports a resource at the specified location, and returns the loaded data. If file contains more than one
+		 * resource only the primary resource is imported (e.g. for an FBX a mesh would be imported, but animations ignored).
+		 *
+		 * @param[in]	inputFilePath	Pathname of the input file.
+		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
+		 *								actually match the type of the importer used for the file type.
+		 * @return						Imported resource.
+		 *
+		 * @see		createImportOptions
+		 */
+		HResource import(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
+
+		/** @copydoc import */
+		template <class T>
+		ResourceHandle<T> import(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr)
+		{
+			return static_resource_cast<T>(import(inputFilePath, importOptions));
+		}
+
+		/**
+		 * Imports a resource at the specified location, and returns the loaded data. This method returns all imported
+		 * resources, which is relevant for files that can contain multiple resources (e.g. an FBX which may contain both
+		 * a mesh and animations). 
+		 *
+		 * @param[in]	inputFilePath	Pathname of the input file.
+		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
+		 *								actually match the type of the importer used for the file type.
+		 * @return						A list of all imported resources. The primary resource is always the first returned
+		 *								resource.
+		 *
+		 * @see		createImportOptions
+		 */
+		Vector<SubResource> importAll(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
+
+		/**
+		 * Imports a resource and replaces the contents of the provided existing resource with new imported data.
+		 *
+		 * @param[in]	inputFilePath	Pathname of the input file.
+		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
+		 *								actually match the type of the importer used for the file type. 
+		 *
+		 * @see		createImportOptions
+		 */
+		void reimport(HResource& existingResource, const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
+
+		/**
+		 * Automatically detects the importer needed for the provided file and returns valid type of import options for 
+		 * that importer.
+		 *
+		 * @param[in]	inputFilePath	Pathname of the input file.
+		 *
+		 * @return						The new import options. Null is returned if the file path is not valid, or if a 
+		 *								valid importer cannot be found for the specified file.
+		 * 			
+		 * @note	
+		 * You will need to type cast the importer options to a valid type, taking into consideration exact importer you 
+		 * expect to be used for this file type. If you don't use a proper import options type, an exception will be thrown 
+		 * during import.
+		 */
+		ImportOptionsPtr createImportOptions(const Path& inputFilePath);
+
+		/** @copydoc createImportOptions */
+		template<class T>
+		SPtr<T> createImportOptions(const Path& inputFilePath)
+		{
+			return std::static_pointer_cast<T>(createImportOptions(inputFilePath));
+		}
+
+		/**
+		 * Checks if we can import a file with the specified extension.
+		 *
+		 * @param[in]	extension	The extension without the leading dot.
+		 */
+		bool supportsFileType(const WString& extension) const;
+
+		/**
+		 * Checks if we can import a file with the specified magic number.
+		 *
+		 * @param[in]	magicNumber 	The buffer containing the magic number.
+		 * @param[in]	magicNumSize	Size of the magic number buffer.
+		 */
+		bool supportsFileType(const UINT8* magicNumber, UINT32 magicNumSize) const;
+
+		/** @cond INTERNAL */
+
+		/**
+		 * Adds a new asset importer for the specified file extension. If an asset importer for that extension already 
+		 * exists, it is removed and replaced with the current one.
+		 *
+		 *
+		 * @param[in]	importer	The importer that is able to handle files with the specified extension. nullptr if you
+		 * 							want to remove an asset importer for the extension.
+		 *
+		 * @note	Internal method. 
+		 * @note	This method should only be called by asset importers themselves on startup. Importer takes ownership
+		 *			of the provided pointer and will release it. Assumes it is allocated using the general allocator.
+		 */
+		void _registerAssetImporter(SpecificImporter* importer);
+
+		/**
+		 * Imports a resource at the specified location but doesn't create resource handles. This method returns all 
+		 * imported resources, which is relevant for files that can contain multiple resources (e.g. an FBX which may
+		 * contain both a mesh and animations). 
+		 *
+		 * @param[in]	inputFilePath	Pathname of the input file.
+		 * @param[in]	importOptions	(optional) Options for controlling the import. Caller must ensure import options 
+		 *								actually match the type of the importer used for the file type.
+		 * @return						A list of all imported resources. The primary resource is always the first returned
+		 *								resource. Caller is responsible for creating resource handles for the returned 
+		 *								values.
+		 *
+		 * @see		createImportOptions
+		 */
+		Vector<SubResourceRaw> _importAllRaw(const Path& inputFilePath, ConstImportOptionsPtr importOptions = nullptr);
+
+		/** @endcond */
+	private:
+		/** 
+		 * Searches available importers and attempts to find one that can import the file of the provided type. Returns null
+		 * if one cannot be found.
+		 */
+		SpecificImporter* getImporterForFile(const Path& inputFilePath) const;
+
+		Vector<SpecificImporter*> mAssetImporters;
+	};
+
+	/** Provides easier access to Importer. */
+	BS_CORE_EXPORT Importer& gImporter();
+
+	/** @} */
 }

+ 657 - 657
Source/BansheeCore/Include/BsSceneObject.h

@@ -1,658 +1,658 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsMatrix4.h"
-#include "BsVector3.h"
-#include "BsQuaternion.h"
-#include "BsRTTIType.h"
-#include "BsGameObjectManager.h"
-#include "BsGameObject.h"
-#include "BsComponent.h"
-
-namespace BansheeEngine
-{
-	/** @addtogroup Scene
-	 *  @{
-	 */
-
-	/** Possible modifiers that can be applied to a SceneObject. */
-	enum SceneObjectFlags
-	{
-		SOF_DontInstantiate = 0x01, /**< Object wont be in the main scene and its components won't receive updates. */
-		SOF_DontSave = 0x02,		/**< Object will be skipped when saving the scene hierarchy or a prefab. */
-		SOF_Persistent = 0x04,		/**< Object will remain in the scene even after scene clear, unless destroyed directly. 
-										 This only works with top-level objects. */
-		SOF_Internal = 0x08			/**< Provides a hint to external systems that his object is used by engine internals.
-									     For example, those systems might not want to display those objects together with the
-										 user created ones. */
-	};
-
-	/**
-	 * An object in the scene graph. It has a world position, place in the hierarchy and optionally a number of attached 
-	 * components.
-	 */
-	class BS_CORE_EXPORT SceneObject : public GameObject
-	{
-		/**	Flags that signify which part of the SceneObject needs updating. */
-		enum DirtyFlags
-		{
-			LocalTfrmDirty = 0x01,
-			WorldTfrmDirty = 0x02
-		};
-
-		friend class CoreSceneManager;
-		friend class Prefab;
-		friend class PrefabDiff;
-		friend class PrefabUtility;
-	public:
-		~SceneObject();
-
-		/**
-		 * Creates a new SceneObject with the specified name. Object will be placed in the top of the scene hierarchy.
-		 *
-		 * @param[in]	name	Name of the scene object.
-		 * @param[in]	flags	Optional flags that control object behavior. See SceneObjectFlags.
-		 */
-		static HSceneObject create(const String& name, UINT32 flags = 0);
-
-		/**
-		 * Destroys this object and any of its held components.
-		 *
-		 * @param [in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the
-		 *							deallocation will be delayed to the end of frame (preferred method).
-		 */
-		void destroy(bool immediate = false);
-
-		/**
-		 * @copydoc	GameObject::_setInstanceData
-		 */
-		void _setInstanceData(GameObjectInstanceDataPtr& other) override;
-
-		/**	Returns a handle to this object. */
-		HSceneObject getHandle() const { return mThisHandle; }
-
-		/**
-		 * Returns the UUID of the prefab this object is linked to, if any. 
-		 *
-		 * @note	Requires a search of all parents potentially.
-		 */
-		String getPrefabLink() const;
-
-		/** 
-		 * Returns the root object of the prefab instance that this object belongs to, if any. Returns null if the object 
-		 * is not part of a prefab instance. 
-		 */
-		HSceneObject getPrefabParent() const;
-
-		/**
-		 * Breaks the link between this prefab instance and its prefab. Object will retain all current values but will no
-		 * longer be influenced by modifications to its parent prefab.
-		 */
-		void breakPrefabLink();
-
-		/**	Checks if the scene object has a specific bit flag set. */
-		bool hasFlag(UINT32 flag) const;
-
-	public: // ***** INTERNAL ******
-		/** @cond INTERNAL */
-
-		/** Register the scene object with the scene and activate all of its components. */
-		void _instantiate();
-
-		/**
-		 * Clears the internally stored prefab diff. If this object is updated from prefab its instance specific changes 
-		 * will be lost.
-		 */
-		void _clearPrefabDiff() { mPrefabDiff = nullptr; }
-
-		/**
-		 * Returns the UUID of the prefab this object is linked to, if any. Unlike getPrefabLink() method this will not
-		 * search parents, but instead return only the value assigned to this object.
-		 */
-		const String& _getPrefabLinkUUID() const { return mPrefabLinkUUID; }
-
-		/**
-		 * Allows you to change the prefab link UUID of this object. Normally this should be accompanied by reassigning the
-		 * link IDs.
-		 */
-		void _setPrefabLinkUUID(const String& UUID) { mPrefabLinkUUID = UUID; }
-
-		/**
-		 * Returns a prefab diff object containing instance specific modifications of this object compared to its prefab
-		 * reference, if any.
-		 */
-		const PrefabDiffPtr& _getPrefabDiff() const { return mPrefabDiff; }
-
-		/** Assigns a new prefab diff object. Caller must ensure the prefab diff was generated for this object. */
-		void _setPrefabDiff(const PrefabDiffPtr& diff) { mPrefabDiff = diff; }
-
-		/** @endcond */
-
-	private:
-		SceneObject(const String& name, UINT32 flags);
-
-		/**
-		 * Creates a new SceneObject instance, registers it with the game object manager, creates and returns a handle to
-		 * the new object.
-		 *
-		 * @note	
-		 * When creating objects with DontInstantiate flag it is the callers responsibility to manually destroy the object,
-		 * otherwise it will leak.
-		 */
-		static HSceneObject createInternal(const String& name, UINT32 flags = 0);
-
-		/**
-		 * Creates a new SceneObject instance from an existing pointer, registers it with the game object manager, creates 
-		 * and returns a handle to the object.
-		 *			
-		 * @param[in]	soPtr		Pointer to the scene object register and return a handle to.
-		 * @param[in]	originalId	If the provided pointer was deserialized, this is the original object's ID at the time
-		 * 							of serialization. Used for resolving handles pointing to the object.
-		 */
-		static HSceneObject createInternal(const SPtr<SceneObject>& soPtr, UINT64 originalId = 0);
-
-		/**
-		 * Destroys this object and any of its held components.
-		 *
-		 * @param[in]	handle		Game object handle to this object.
-		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the 
-		 *							deallocation will be delayed to the end of frame (preferred method).
-		 *
-		 * @note	Unlike destroy(), does not remove the object from its parent.
-		 */
-		void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) override;
-
-		/** Recursively enables the provided set of flags on this object and all children. */
-		void setFlags(UINT32 flags);
-
-		/** Recursively disables the provided set of flags on this object and all children. */
-		void unsetFlags(UINT32 flags);
-
-		/**	Checks is the scene object instantiated and visible in the scene. */
-		bool isInstantiated() const { return (mFlags & SOF_DontInstantiate) == 0; }
-
-	private:
-		HSceneObject mThisHandle;
-		String mPrefabLinkUUID;
-		PrefabDiffPtr mPrefabDiff;
-		UINT32 mPrefabHash;
-		UINT32 mFlags;
-
-		/************************************************************************/
-		/* 								Transform	                     		*/
-		/************************************************************************/
-	public:
-		/**	Sets the local position of the object. */
-		void setPosition(const Vector3& position);
-
-		/**	Gets the local position of the object. */
-		const Vector3& getPosition() const { return mPosition; }
-
-		/**	Sets the world position of the object. */
-		void setWorldPosition(const Vector3& position);
-
-		/**
-		 * Gets the world position of the object.
-		 *
-		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
-		 */
-		const Vector3& getWorldPosition() const;
-
-		/**	Sets the local rotation of the object. */
-		void setRotation(const Quaternion& rotation);
-
-		/**	Gets the local rotation of the object. */
-		const Quaternion& getRotation() const { return mRotation; }
-
-		/**	Sets the world rotation of the object. */
-		void setWorldRotation(const Quaternion& rotation);
-
-		/**
-		 * Gets world rotation of the object.
-		 *
-		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
-		 */
-		const Quaternion& getWorldRotation() const;
-
-		/**	Sets the local scale of the object. */
-		void setScale(const Vector3& scale);
-
-		/**	Gets the local scale of the object. */
-		const Vector3& getScale() const { return mScale; }
-
-		/**
-		 * Sets the world scale of the object.
-		 *
-		 * @note	This will not work properly if this object or any of its parents have non-affine transform matrices.
-		 */
-		void setWorldScale(const Vector3& scale);
-
-		/**
-		 * Gets world scale of the object.
-		 *
-		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
-		 */
-		const Vector3& getWorldScale() const;
-
-		/**
-		 * Orients the object so it is looking at the provided @p location (world space) where @p up is used for 
-		 * determining the location of the object's Y axis.
-		 */
-		void lookAt(const Vector3& location, const Vector3& up = Vector3::UNIT_Y);
-
-		/**
-		 * Gets the objects world transform matrix.
-		 *
-		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
-		 */
-		const Matrix4& getWorldTfrm() const;
-
-		/**
-		 * Gets the objects inverse world transform matrix.
-		 *
-		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
-		 */
-		Matrix4 getInvWorldTfrm() const;
-
-		/** Gets the objects local transform matrix. */
-		const Matrix4& getLocalTfrm() const;
-
-		/**	Moves the object's position by the vector offset provided along world axes. */
-        void move(const Vector3& vec);
-
-		/**	Moves the object's position by the vector offset provided along it's own axes (relative to orientation). */
-        void moveRelative(const Vector3& vec);
-
-		/**
-		 * Gets the Z (forward) axis of the object, in world space.
-		 *
-		 * @return	Forward axis of the object.
-		 */
-		Vector3 getForward() const { return getWorldRotation().rotate(-Vector3::UNIT_Z); }
-
-		/**
-		 * Gets the Y (up) axis of the object, in world space.
-		 *
-		 * @return	Up axis of the object.
-		 */
-		Vector3 getUp() const { return getWorldRotation().rotate(Vector3::UNIT_Y); }
-
-		/**
-		 * Gets the X (right) axis of the object, in world space.
-		 *
-		 * @return	Right axis of the object.
-		 */
-		Vector3 getRight() const { return getWorldRotation().rotate(Vector3::UNIT_X); }
-
-		/**
-		 * Rotates the game object so it's forward axis faces the provided direction.
-		 *
-		 * @param[in]	forwardDir	The forward direction to face, in world space.
-		 *
-		 * @note	Local forward axis is considered to be negative Z.
-		 */
-		void setForward(const Vector3& forwardDir);
-
-		/**	Rotate the object around an arbitrary axis. */
-        void rotate(const Vector3& axis, const Radian& angle);
-
-		/**	Rotate the object around an arbitrary axis using a Quaternion. */
-        void rotate(const Quaternion& q);
-
-		/**
-		 * Rotates around local Z axis.
-		 *
-		 * @param[in]	angle	Angle to rotate by.
-		 */
-		void roll(const Radian& angle);
-
-		/**
-		 * Rotates around Y axis.
-		 *
-		 * @param[in]	angle	Angle to rotate by.
-		 */
-		void yaw(const Radian& angle);
-
-		/**
-		 * Rotates around X axis
-		 *
-		 * @param[in]	angle	Angle to rotate by.
-		 */
-		void pitch(const Radian& angle);
-
-		/**
-		 * Forces any dirty transform matrices on this object to be updated.
-		 *
-		 * @note	
-		 * Normally this is done internally when retrieving a transform, but sometimes it is useful to update transforms
-		 * manually.
-		 */
-		void updateTransformsIfDirty();
-
-		/**
-		 * Returns a hash value that changes whenever a scene objects transform gets updated. It allows you to detect 
-		 * changes with the local or world transforms without directly comparing their values with some older state.
-		 */
-		UINT32 getTransformHash() const { return mDirtyHash; }
-
-	private:
-		Vector3 mPosition;
-		Quaternion mRotation;
-		Vector3 mScale;
-
-		mutable Vector3 mWorldPosition;
-		mutable Quaternion mWorldRotation;
-		mutable Vector3 mWorldScale;
-
-		mutable Matrix4 mCachedLocalTfrm;
-		mutable Matrix4 mCachedWorldTfrm;
-
-		mutable UINT32 mDirtyFlags;
-		mutable UINT32 mDirtyHash;
-
-		/** 
-		 * Notifies components and child scene object that a transform has been changed.  
-		 * 
-		 * @param	flags	Specifies in what way was the transform changed.
-		 */
-		void notifyTransformChanged(TransformChangedFlags flags) const;
-
-		/** Updates the local transform. Normally just reconstructs the transform matrix from the position/rotation/scale. */
-		void updateLocalTfrm() const;
-
-		/**
-		 * Updates the world transform. Reconstructs the local transform matrix and multiplies it with any parent transforms.
-		 *
-		 * @note	If parent transforms are dirty they will be updated.
-		 */
-		void updateWorldTfrm() const;
-
-		/**	Checks if cached local transform needs updating. */
-		bool isCachedLocalTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::LocalTfrmDirty) == 0; }
-
-		/**	Checks if cached world transform needs updating. */
-		bool isCachedWorldTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::WorldTfrmDirty) == 0; }
-
-		/************************************************************************/
-		/* 								Hierarchy	                     		*/
-		/************************************************************************/
-	public:
-		/**
-		 * Changes the parent of this object. Also removes the object from the current parent, and assigns it to the new 
-		 * parent.
-		 *
-		 * @param[in]	parent			New parent.
-		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
-		 *								changed (this means the local transform will be modified accordingly).
-		 */
-		void setParent(const HSceneObject& parent, bool keepWorldTransform = true);
-
-		/**
-		 * Gets the parent of this object.
-		 *
-		 * @return	Parent object, or nullptr if this SceneObject is at root level.
-		 */
-		HSceneObject getParent() const { return mParent; }
-
-		/**
-		 * Gets a child of this item.
-		 *
-		 * @param[in]	idx	The zero based index of the child.
-		 * @return		SceneObject of the child.
-		 */
-		HSceneObject getChild(UINT32 idx) const;
-
-		/**
-		 * Find the index of the specified child. Don't persist this value as it may change whenever you add/remove children.
-		 *
-		 * @param[in]	child	The child to look for.
-		 * @return				The zero-based index of the found child, or -1 if no match was found.
-		 */
-		int indexOfChild(const HSceneObject& child) const;
-
-		/**	Gets the number of all child GameObjects. */
-		UINT32 getNumChildren() const { return (UINT32)mChildren.size(); }
-
-		/**
-		 * Searches the child objects for an object matching the specified name.
-		 *
-		 * @param[in]	name		Name of the object to locate.
-		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
-		 *							children.
-		 * @return					First found scene object, or empty handle if none found.
-		 */
-		HSceneObject findChild(const String& name, bool recursive = true);
-
-		/**
-		 * Searches the child objects for objects matching the specified name.
-		 *
-		 * @param[in]	name		Name of the objects to locate.
-		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
-		 *							children.
-		 * @return					All scene objects matching the specified name.
-		 */
-		Vector<HSceneObject> findChildren(const String& name, bool recursive = true);
-
-		/**
-		 * Enables or disables this object. Disabled objects also implicitly disable all their child objects. No components
-		 * on the disabled object are updated.
-		 */
-		void setActive(bool active);
-
-		/**
-		 * Returns whether or not an object is active.
-		 *
-		 * @param[in]	self	If true, the method will only check if this particular object was activated or deactivated
-		 *						directly via setActive. If false we we also check if any of the objects parents are inactive.
-		 */
-		bool getActive(bool self = false);
-
-		/**
-		 * Makes a deep copy of this object.
-		 * 			
-		 * @param[in]	instantiate	If false, the cloned hierarchy will just be a memory copy, but will not be present in the
-		 * 							scene or otherwise active until ::instantiate() is called.
-		 */
-		HSceneObject clone(bool instantiate = true);
-
-	private:
-		HSceneObject mParent;
-		Vector<HSceneObject> mChildren;
-		bool mActiveSelf;
-		bool mActiveHierarchy;
-
-		/**
-		 * Internal version of setParent() that allows you to set a null parent.
-		 *
-		 * @param[in]	parent			New parent.
-		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
-		 *								changed (this means the local transform will be modified accordingly).
-		 */
-		void _setParent(const HSceneObject& parent, bool keepWorldTransform = true);
-
-		/**
-		 * Adds a child to the child array. This method doesn't check for null or duplicate values.
-		 *
-		 * @param[in]	object	New child.
-		 */
-		void addChild(const HSceneObject& object);
-		
-		/**
-		 * Removes the child from the object. 
-		 *
-		 * @param[in]	object	Child to remove.
-		 */
-		void removeChild(const HSceneObject& object);
-
-		/** Changes the object active in hierarchy state. */
-		void setActiveHierarchy(bool active);
-
-		/************************************************************************/
-		/* 								Component	                     		*/
-		/************************************************************************/
-	public:
-		/** Constructs a new component of the specified type and adds it to the internal component list. */
-		template<class T, class... Args>
-		GameObjectHandle<T> addComponent(Args &&... args)
-		{
-			static_assert((std::is_base_of<BansheeEngine::Component, T>::value),
-				"Specified type is not a valid Component.");
-
-			std::shared_ptr<T> gameObject(new (bs_alloc<T>()) T(mThisHandle,
-				std::forward<Args>(args)...),
-				&bs_delete<T>, StdAlloc<T>());
-
-			GameObjectHandle<T> newComponent =
-				GameObjectManager::instance().registerObject(gameObject);
-
-			newComponent->mThisHandle = newComponent;
-			mComponents.push_back(newComponent);
-
-			if (isInstantiated())
-			{
-				newComponent->instantiate();
-				newComponent->onInitialized();
-
-				if (getActive())
-					newComponent->onEnabled();
-			}
-
-			return newComponent;
-		}
-
-		/**
-		 * Searches for a component with the specific type and returns the first one it finds. Will also return components
-		 * derived from the type.
-		 * 			
-		 * @tparam	typename T	Type of the component.
-		 * @return				Component if found, nullptr otherwise.
-		 *
-		 * @note	
-		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result 
-		 * for further use.
-		 */
-		template <typename T>
-		GameObjectHandle<T> getComponent()
-		{
-			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
-				"Specified type is not a valid Component.");
-
-			return static_object_cast<T>(getComponent(T::getRTTIStatic()));
-		}
-
-		/**
-		 * Returns all components with the specific type. Will also return components derived from the type.
-		 * 			
-		 * @tparam	typename T	Type of the component.
-		 * @return				Array of found components.
-		 *
-		 * @note	
-		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result 
-		 * for further use.
-		 */
-		template <typename T>
-		Vector<GameObjectHandle<T>> getComponents()
-		{
-			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
-				"Specified type is not a valid Component.");
-
-			Vector<GameObjectHandle<T>> output;
-
-			for (auto entry : mComponents)
-			{
-				if (entry->getRTTI()->isDerivedFrom(T::getRTTIStatic()))
-					output.push_back(entry);
-			}
-
-			return output;
-		}
-
-		/**
-		 * Checks if the current object contains the specified component or components derived from the provided type.
-		 * 			 			
-		 * @tparam	typename T	Type of the component.
-		 * @return				True if component exists on the object.
-		 *
-		 * @note	Don't call this too often as it is relatively slow.
-		 */
-		template <typename T>
-		bool hasComponent()
-		{
-			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
-				"Specified type is not a valid Component.");
-
-			for (auto entry : mComponents)
-			{
-				if (entry->getRTTI()->isDerivedFrom(T::getRTTIStatic()))
-					return true;
-			}
-
-			return false;
-		}
-
-		/**
-		 * Searches for a component with the specified type and returns the first one it finds. Will also return components
-		 * derived from the type.
-		 * 			
-		 * @param[in]	type	RTTI information for the type.
-		 * @return				Component if found, nullptr otherwise.
-		 *
-		 * @note	
-		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result
-		 * for further use.
-		 */
-		HComponent getComponent(RTTITypeBase* type) const;
-
-		/**
-		 * Removes the component from this object, and deallocates it. 
-		 *
-		 * @param[in]	component	The component to destroy.
-		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
-		 *							the deallocation will be delayed to the end of frame (preferred method).
-		 */
-		void destroyComponent(const HComponent component, bool immediate = false);
-
-		/**
-		 * Removes the component from this object, and deallocates it.
-		 *
-		 * @param[in]	component	The component to destroy.
-		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
-		 *							the deallocation will be delayed to the end of frame (preferred method).
-		 */
-		void destroyComponent(Component* component, bool immediate = false);
-
-		/**	Returns all components on this object. */
-		const Vector<HComponent>& getComponents() const { return mComponents; }
-
-	private:
-		/**	Creates an empty component with the default constructor. */
-		template <typename T>
-		static std::shared_ptr<T> createEmptyComponent()
-		{
-			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), "Specified type is not a valid Component.");
-
-			T* rawPtr = new (bs_alloc<T>()) T();
-			std::shared_ptr<T> gameObject(rawPtr, &bs_delete<T>, StdAlloc<T>());
-
-			return gameObject;
-		}
-
-		/**	Adds the component to the internal component array. */
-		void addComponentInternal(const std::shared_ptr<Component> component);
-
-		Vector<HComponent> mComponents;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class GameObjectRTTI;
-		friend class SceneObjectRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
-
-	/** @} */
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsMatrix4.h"
+#include "BsVector3.h"
+#include "BsQuaternion.h"
+#include "BsRTTIType.h"
+#include "BsGameObjectManager.h"
+#include "BsGameObject.h"
+#include "BsComponent.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/** Possible modifiers that can be applied to a SceneObject. */
+	enum SceneObjectFlags
+	{
+		SOF_DontInstantiate = 0x01, /**< Object wont be in the main scene and its components won't receive updates. */
+		SOF_DontSave = 0x02,		/**< Object will be skipped when saving the scene hierarchy or a prefab. */
+		SOF_Persistent = 0x04,		/**< Object will remain in the scene even after scene clear, unless destroyed directly. 
+										 This only works with top-level objects. */
+		SOF_Internal = 0x08			/**< Provides a hint to external systems that his object is used by engine internals.
+									     For example, those systems might not want to display those objects together with the
+										 user created ones. */
+	};
+
+	/**
+	 * An object in the scene graph. It has a world position, place in the hierarchy and optionally a number of attached 
+	 * components.
+	 */
+	class BS_CORE_EXPORT SceneObject : public GameObject
+	{
+		/**	Flags that signify which part of the SceneObject needs updating. */
+		enum DirtyFlags
+		{
+			LocalTfrmDirty = 0x01,
+			WorldTfrmDirty = 0x02
+		};
+
+		friend class CoreSceneManager;
+		friend class Prefab;
+		friend class PrefabDiff;
+		friend class PrefabUtility;
+	public:
+		~SceneObject();
+
+		/**
+		 * Creates a new SceneObject with the specified name. Object will be placed in the top of the scene hierarchy.
+		 *
+		 * @param[in]	name	Name of the scene object.
+		 * @param[in]	flags	Optional flags that control object behavior. See SceneObjectFlags.
+		 */
+		static HSceneObject create(const String& name, UINT32 flags = 0);
+
+		/**
+		 * Destroys this object and any of its held components.
+		 *
+		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the
+		 *							deallocation will be delayed to the end of frame (preferred method).
+		 */
+		void destroy(bool immediate = false);
+
+		/**
+		 * @copydoc	GameObject::_setInstanceData
+		 */
+		void _setInstanceData(GameObjectInstanceDataPtr& other) override;
+
+		/**	Returns a handle to this object. */
+		HSceneObject getHandle() const { return mThisHandle; }
+
+		/**
+		 * Returns the UUID of the prefab this object is linked to, if any. 
+		 *
+		 * @note	Requires a search of all parents potentially.
+		 */
+		String getPrefabLink() const;
+
+		/** 
+		 * Returns the root object of the prefab instance that this object belongs to, if any. Returns null if the object 
+		 * is not part of a prefab instance. 
+		 */
+		HSceneObject getPrefabParent() const;
+
+		/**
+		 * Breaks the link between this prefab instance and its prefab. Object will retain all current values but will no
+		 * longer be influenced by modifications to its parent prefab.
+		 */
+		void breakPrefabLink();
+
+		/**	Checks if the scene object has a specific bit flag set. */
+		bool hasFlag(UINT32 flag) const;
+
+	public: // ***** INTERNAL ******
+		/** @cond INTERNAL */
+
+		/** Register the scene object with the scene and activate all of its components. */
+		void _instantiate();
+
+		/**
+		 * Clears the internally stored prefab diff. If this object is updated from prefab its instance specific changes 
+		 * will be lost.
+		 */
+		void _clearPrefabDiff() { mPrefabDiff = nullptr; }
+
+		/**
+		 * Returns the UUID of the prefab this object is linked to, if any. Unlike getPrefabLink() method this will not
+		 * search parents, but instead return only the value assigned to this object.
+		 */
+		const String& _getPrefabLinkUUID() const { return mPrefabLinkUUID; }
+
+		/**
+		 * Allows you to change the prefab link UUID of this object. Normally this should be accompanied by reassigning the
+		 * link IDs.
+		 */
+		void _setPrefabLinkUUID(const String& UUID) { mPrefabLinkUUID = UUID; }
+
+		/**
+		 * Returns a prefab diff object containing instance specific modifications of this object compared to its prefab
+		 * reference, if any.
+		 */
+		const PrefabDiffPtr& _getPrefabDiff() const { return mPrefabDiff; }
+
+		/** Assigns a new prefab diff object. Caller must ensure the prefab diff was generated for this object. */
+		void _setPrefabDiff(const PrefabDiffPtr& diff) { mPrefabDiff = diff; }
+
+		/** @endcond */
+
+	private:
+		SceneObject(const String& name, UINT32 flags);
+
+		/**
+		 * Creates a new SceneObject instance, registers it with the game object manager, creates and returns a handle to
+		 * the new object.
+		 *
+		 * @note	
+		 * When creating objects with DontInstantiate flag it is the callers responsibility to manually destroy the object,
+		 * otherwise it will leak.
+		 */
+		static HSceneObject createInternal(const String& name, UINT32 flags = 0);
+
+		/**
+		 * Creates a new SceneObject instance from an existing pointer, registers it with the game object manager, creates 
+		 * and returns a handle to the object.
+		 *			
+		 * @param[in]	soPtr		Pointer to the scene object register and return a handle to.
+		 * @param[in]	originalId	If the provided pointer was deserialized, this is the original object's ID at the time
+		 * 							of serialization. Used for resolving handles pointing to the object.
+		 */
+		static HSceneObject createInternal(const SPtr<SceneObject>& soPtr, UINT64 originalId = 0);
+
+		/**
+		 * Destroys this object and any of its held components.
+		 *
+		 * @param[in]	handle		Game object handle to this object.
+		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the 
+		 *							deallocation will be delayed to the end of frame (preferred method).
+		 *
+		 * @note	Unlike destroy(), does not remove the object from its parent.
+		 */
+		void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) override;
+
+		/** Recursively enables the provided set of flags on this object and all children. */
+		void setFlags(UINT32 flags);
+
+		/** Recursively disables the provided set of flags on this object and all children. */
+		void unsetFlags(UINT32 flags);
+
+		/**	Checks is the scene object instantiated and visible in the scene. */
+		bool isInstantiated() const { return (mFlags & SOF_DontInstantiate) == 0; }
+
+	private:
+		HSceneObject mThisHandle;
+		String mPrefabLinkUUID;
+		PrefabDiffPtr mPrefabDiff;
+		UINT32 mPrefabHash;
+		UINT32 mFlags;
+
+		/************************************************************************/
+		/* 								Transform	                     		*/
+		/************************************************************************/
+	public:
+		/**	Sets the local position of the object. */
+		void setPosition(const Vector3& position);
+
+		/**	Gets the local position of the object. */
+		const Vector3& getPosition() const { return mPosition; }
+
+		/**	Sets the world position of the object. */
+		void setWorldPosition(const Vector3& position);
+
+		/**
+		 * Gets the world position of the object.
+		 *
+		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
+		 */
+		const Vector3& getWorldPosition() const;
+
+		/**	Sets the local rotation of the object. */
+		void setRotation(const Quaternion& rotation);
+
+		/**	Gets the local rotation of the object. */
+		const Quaternion& getRotation() const { return mRotation; }
+
+		/**	Sets the world rotation of the object. */
+		void setWorldRotation(const Quaternion& rotation);
+
+		/**
+		 * Gets world rotation of the object.
+		 *
+		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
+		 */
+		const Quaternion& getWorldRotation() const;
+
+		/**	Sets the local scale of the object. */
+		void setScale(const Vector3& scale);
+
+		/**	Gets the local scale of the object. */
+		const Vector3& getScale() const { return mScale; }
+
+		/**
+		 * Sets the world scale of the object.
+		 *
+		 * @note	This will not work properly if this object or any of its parents have non-affine transform matrices.
+		 */
+		void setWorldScale(const Vector3& scale);
+
+		/**
+		 * Gets world scale of the object.
+		 *
+		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
+		 */
+		const Vector3& getWorldScale() const;
+
+		/**
+		 * Orients the object so it is looking at the provided @p location (world space) where @p up is used for 
+		 * determining the location of the object's Y axis.
+		 */
+		void lookAt(const Vector3& location, const Vector3& up = Vector3::UNIT_Y);
+
+		/**
+		 * Gets the objects world transform matrix.
+		 *
+		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
+		 */
+		const Matrix4& getWorldTfrm() const;
+
+		/**
+		 * Gets the objects inverse world transform matrix.
+		 *
+		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
+		 */
+		Matrix4 getInvWorldTfrm() const;
+
+		/** Gets the objects local transform matrix. */
+		const Matrix4& getLocalTfrm() const;
+
+		/**	Moves the object's position by the vector offset provided along world axes. */
+        void move(const Vector3& vec);
+
+		/**	Moves the object's position by the vector offset provided along it's own axes (relative to orientation). */
+        void moveRelative(const Vector3& vec);
+
+		/**
+		 * Gets the Z (forward) axis of the object, in world space.
+		 *
+		 * @return	Forward axis of the object.
+		 */
+		Vector3 getForward() const { return getWorldRotation().rotate(-Vector3::UNIT_Z); }
+
+		/**
+		 * Gets the Y (up) axis of the object, in world space.
+		 *
+		 * @return	Up axis of the object.
+		 */
+		Vector3 getUp() const { return getWorldRotation().rotate(Vector3::UNIT_Y); }
+
+		/**
+		 * Gets the X (right) axis of the object, in world space.
+		 *
+		 * @return	Right axis of the object.
+		 */
+		Vector3 getRight() const { return getWorldRotation().rotate(Vector3::UNIT_X); }
+
+		/**
+		 * Rotates the game object so it's forward axis faces the provided direction.
+		 *
+		 * @param[in]	forwardDir	The forward direction to face, in world space.
+		 *
+		 * @note	Local forward axis is considered to be negative Z.
+		 */
+		void setForward(const Vector3& forwardDir);
+
+		/**	Rotate the object around an arbitrary axis. */
+        void rotate(const Vector3& axis, const Radian& angle);
+
+		/**	Rotate the object around an arbitrary axis using a Quaternion. */
+        void rotate(const Quaternion& q);
+
+		/**
+		 * Rotates around local Z axis.
+		 *
+		 * @param[in]	angle	Angle to rotate by.
+		 */
+		void roll(const Radian& angle);
+
+		/**
+		 * Rotates around Y axis.
+		 *
+		 * @param[in]	angle	Angle to rotate by.
+		 */
+		void yaw(const Radian& angle);
+
+		/**
+		 * Rotates around X axis
+		 *
+		 * @param[in]	angle	Angle to rotate by.
+		 */
+		void pitch(const Radian& angle);
+
+		/**
+		 * Forces any dirty transform matrices on this object to be updated.
+		 *
+		 * @note	
+		 * Normally this is done internally when retrieving a transform, but sometimes it is useful to update transforms
+		 * manually.
+		 */
+		void updateTransformsIfDirty();
+
+		/**
+		 * Returns a hash value that changes whenever a scene objects transform gets updated. It allows you to detect 
+		 * changes with the local or world transforms without directly comparing their values with some older state.
+		 */
+		UINT32 getTransformHash() const { return mDirtyHash; }
+
+	private:
+		Vector3 mPosition;
+		Quaternion mRotation;
+		Vector3 mScale;
+
+		mutable Vector3 mWorldPosition;
+		mutable Quaternion mWorldRotation;
+		mutable Vector3 mWorldScale;
+
+		mutable Matrix4 mCachedLocalTfrm;
+		mutable Matrix4 mCachedWorldTfrm;
+
+		mutable UINT32 mDirtyFlags;
+		mutable UINT32 mDirtyHash;
+
+		/** 
+		 * Notifies components and child scene object that a transform has been changed.  
+		 * 
+		 * @param	flags	Specifies in what way was the transform changed.
+		 */
+		void notifyTransformChanged(TransformChangedFlags flags) const;
+
+		/** Updates the local transform. Normally just reconstructs the transform matrix from the position/rotation/scale. */
+		void updateLocalTfrm() const;
+
+		/**
+		 * Updates the world transform. Reconstructs the local transform matrix and multiplies it with any parent transforms.
+		 *
+		 * @note	If parent transforms are dirty they will be updated.
+		 */
+		void updateWorldTfrm() const;
+
+		/**	Checks if cached local transform needs updating. */
+		bool isCachedLocalTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::LocalTfrmDirty) == 0; }
+
+		/**	Checks if cached world transform needs updating. */
+		bool isCachedWorldTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::WorldTfrmDirty) == 0; }
+
+		/************************************************************************/
+		/* 								Hierarchy	                     		*/
+		/************************************************************************/
+	public:
+		/**
+		 * Changes the parent of this object. Also removes the object from the current parent, and assigns it to the new 
+		 * parent.
+		 *
+		 * @param[in]	parent			New parent.
+		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
+		 *								changed (this means the local transform will be modified accordingly).
+		 */
+		void setParent(const HSceneObject& parent, bool keepWorldTransform = true);
+
+		/**
+		 * Gets the parent of this object.
+		 *
+		 * @return	Parent object, or nullptr if this SceneObject is at root level.
+		 */
+		HSceneObject getParent() const { return mParent; }
+
+		/**
+		 * Gets a child of this item.
+		 *
+		 * @param[in]	idx	The zero based index of the child.
+		 * @return		SceneObject of the child.
+		 */
+		HSceneObject getChild(UINT32 idx) const;
+
+		/**
+		 * Find the index of the specified child. Don't persist this value as it may change whenever you add/remove children.
+		 *
+		 * @param[in]	child	The child to look for.
+		 * @return				The zero-based index of the found child, or -1 if no match was found.
+		 */
+		int indexOfChild(const HSceneObject& child) const;
+
+		/**	Gets the number of all child GameObjects. */
+		UINT32 getNumChildren() const { return (UINT32)mChildren.size(); }
+
+		/**
+		 * Searches the child objects for an object matching the specified name.
+		 *
+		 * @param[in]	name		Name of the object to locate.
+		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
+		 *							children.
+		 * @return					First found scene object, or empty handle if none found.
+		 */
+		HSceneObject findChild(const String& name, bool recursive = true);
+
+		/**
+		 * Searches the child objects for objects matching the specified name.
+		 *
+		 * @param[in]	name		Name of the objects to locate.
+		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
+		 *							children.
+		 * @return					All scene objects matching the specified name.
+		 */
+		Vector<HSceneObject> findChildren(const String& name, bool recursive = true);
+
+		/**
+		 * Enables or disables this object. Disabled objects also implicitly disable all their child objects. No components
+		 * on the disabled object are updated.
+		 */
+		void setActive(bool active);
+
+		/**
+		 * Returns whether or not an object is active.
+		 *
+		 * @param[in]	self	If true, the method will only check if this particular object was activated or deactivated
+		 *						directly via setActive. If false we we also check if any of the objects parents are inactive.
+		 */
+		bool getActive(bool self = false);
+
+		/**
+		 * Makes a deep copy of this object.
+		 * 			
+		 * @param[in]	instantiate	If false, the cloned hierarchy will just be a memory copy, but will not be present in the
+		 * 							scene or otherwise active until ::instantiate() is called.
+		 */
+		HSceneObject clone(bool instantiate = true);
+
+	private:
+		HSceneObject mParent;
+		Vector<HSceneObject> mChildren;
+		bool mActiveSelf;
+		bool mActiveHierarchy;
+
+		/**
+		 * Internal version of setParent() that allows you to set a null parent.
+		 *
+		 * @param[in]	parent			New parent.
+		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
+		 *								changed (this means the local transform will be modified accordingly).
+		 */
+		void _setParent(const HSceneObject& parent, bool keepWorldTransform = true);
+
+		/**
+		 * Adds a child to the child array. This method doesn't check for null or duplicate values.
+		 *
+		 * @param[in]	object	New child.
+		 */
+		void addChild(const HSceneObject& object);
+		
+		/**
+		 * Removes the child from the object. 
+		 *
+		 * @param[in]	object	Child to remove.
+		 */
+		void removeChild(const HSceneObject& object);
+
+		/** Changes the object active in hierarchy state. */
+		void setActiveHierarchy(bool active);
+
+		/************************************************************************/
+		/* 								Component	                     		*/
+		/************************************************************************/
+	public:
+		/** Constructs a new component of the specified type and adds it to the internal component list. */
+		template<class T, class... Args>
+		GameObjectHandle<T> addComponent(Args &&... args)
+		{
+			static_assert((std::is_base_of<BansheeEngine::Component, T>::value),
+				"Specified type is not a valid Component.");
+
+			std::shared_ptr<T> gameObject(new (bs_alloc<T>()) T(mThisHandle,
+				std::forward<Args>(args)...),
+				&bs_delete<T>, StdAlloc<T>());
+
+			GameObjectHandle<T> newComponent =
+				GameObjectManager::instance().registerObject(gameObject);
+
+			newComponent->mThisHandle = newComponent;
+			mComponents.push_back(newComponent);
+
+			if (isInstantiated())
+			{
+				newComponent->instantiate();
+				newComponent->onInitialized();
+
+				if (getActive())
+					newComponent->onEnabled();
+			}
+
+			return newComponent;
+		}
+
+		/**
+		 * Searches for a component with the specific type and returns the first one it finds. Will also return components
+		 * derived from the type.
+		 * 			
+		 * @tparam	typename T	Type of the component.
+		 * @return				Component if found, nullptr otherwise.
+		 *
+		 * @note	
+		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result 
+		 * for further use.
+		 */
+		template <typename T>
+		GameObjectHandle<T> getComponent()
+		{
+			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
+				"Specified type is not a valid Component.");
+
+			return static_object_cast<T>(getComponent(T::getRTTIStatic()));
+		}
+
+		/**
+		 * Returns all components with the specific type. Will also return components derived from the type.
+		 * 			
+		 * @tparam	typename T	Type of the component.
+		 * @return				Array of found components.
+		 *
+		 * @note	
+		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result 
+		 * for further use.
+		 */
+		template <typename T>
+		Vector<GameObjectHandle<T>> getComponents()
+		{
+			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
+				"Specified type is not a valid Component.");
+
+			Vector<GameObjectHandle<T>> output;
+
+			for (auto entry : mComponents)
+			{
+				if (entry->getRTTI()->isDerivedFrom(T::getRTTIStatic()))
+					output.push_back(entry);
+			}
+
+			return output;
+		}
+
+		/**
+		 * Checks if the current object contains the specified component or components derived from the provided type.
+		 * 			 			
+		 * @tparam	typename T	Type of the component.
+		 * @return				True if component exists on the object.
+		 *
+		 * @note	Don't call this too often as it is relatively slow.
+		 */
+		template <typename T>
+		bool hasComponent()
+		{
+			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), 
+				"Specified type is not a valid Component.");
+
+			for (auto entry : mComponents)
+			{
+				if (entry->getRTTI()->isDerivedFrom(T::getRTTIStatic()))
+					return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Searches for a component with the specified type and returns the first one it finds. Will also return components
+		 * derived from the type.
+		 * 			
+		 * @param[in]	type	RTTI information for the type.
+		 * @return				Component if found, nullptr otherwise.
+		 *
+		 * @note	
+		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result
+		 * for further use.
+		 */
+		HComponent getComponent(RTTITypeBase* type) const;
+
+		/**
+		 * Removes the component from this object, and deallocates it. 
+		 *
+		 * @param[in]	component	The component to destroy.
+		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
+		 *							the deallocation will be delayed to the end of frame (preferred method).
+		 */
+		void destroyComponent(const HComponent component, bool immediate = false);
+
+		/**
+		 * Removes the component from this object, and deallocates it.
+		 *
+		 * @param[in]	component	The component to destroy.
+		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
+		 *							the deallocation will be delayed to the end of frame (preferred method).
+		 */
+		void destroyComponent(Component* component, bool immediate = false);
+
+		/**	Returns all components on this object. */
+		const Vector<HComponent>& getComponents() const { return mComponents; }
+
+	private:
+		/**	Creates an empty component with the default constructor. */
+		template <typename T>
+		static std::shared_ptr<T> createEmptyComponent()
+		{
+			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), "Specified type is not a valid Component.");
+
+			T* rawPtr = new (bs_alloc<T>()) T();
+			std::shared_ptr<T> gameObject(rawPtr, &bs_delete<T>, StdAlloc<T>());
+
+			return gameObject;
+		}
+
+		/**	Adds the component to the internal component array. */
+		void addComponentInternal(const std::shared_ptr<Component> component);
+
+		Vector<HComponent> mComponents;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class GameObjectRTTI;
+		friend class SceneObjectRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
 }

+ 98 - 98
Source/BansheeEditor/Include/BsEditorWidgetManager.h

@@ -1,99 +1,99 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/** @cond INTERNAL */
-	/** @addtogroup EditorWindow
-	 *  @{
-	 */
-
-	/**
-	 * Handles opening and closing of EditorWidgets. Its primary purpose is to keep track of all types of widgets so they
-	 * can be saved and restored upon program shutdown/startup, as well as being able to change widget layout on the fly.
-	 */
-	class BS_ED_EXPORT EditorWidgetManager : public Module<EditorWidgetManager>
-	{
-	public:
-		EditorWidgetManager();
-		~EditorWidgetManager();
-
-		/**	Called every frame. */
-		void update();
-
-		/**
-		 * Registers a widget that can then be opened by calling open(). When loading a widget layout this name and callback
-		 * will be used to attempt creating the widget.
-		 *
-		 * @param[in]	name				  	Unique name for the widget.
-		 * @param [in]	createCallback			Callback that returns a new instance of the widget.
-		 */
-		void registerWidget(const String& name, std::function<EditorWidgetBase*(EditorWidgetContainer&)> createCallback);
-
-		/**	Unregisters a widget so it may no longer be opened using this manager. */
-		void unregisterWidget(const String& name);
-
-		/**
-		 * Creates a widget with the given name. If widget is already created it returns the existing instance.	Widget is
-		 * opened in a new window.
-		 *
-		 * @param[in]	name	The name of the widget.
-		 * @return				Always returns the created widget, and throws an exception if it fails.
-		 */
-		EditorWidgetBase* open(const String& name);
-
-		/**	Creates a new widget an inserts it into the specified container. */
-		EditorWidgetBase* create(const String& name, EditorWidgetContainer& parentContainer);
-
-		/**	Checks if the provided name represents a widget that can be created. */
-		bool isValidWidget(const String& name) const;
-
-		/**	Closes the given widget. */
-		void close(EditorWidgetBase* widget);
-
-		/**	Closes all open editor widgets. */
-		void closeAll();
-
-		/**
-		 * Retrieves the layout of all currently active widgets. You may later use this layout to restore exact position of
-		 * the widgets.
-		 */
-		EditorWidgetLayoutPtr getLayout() const;
-
-		/**
-		 * Positions all widgets according to the provided layout. It will open new widgets or close current ones if needed.
-		 */
-		void setLayout(const EditorWidgetLayoutPtr& layout);
-
-		/**
-		 * Allows you to queue up widgets that will be registered as soon as an instance of EditorWidgetManager is created.
-		 *
-		 * @note	
-		 * Useful primarily when widgets are being registered from static methods, because then there is no
-		 * EditorWidgetManager instance yet.
-		 */
-		static void preRegisterWidget(const String& name, std::function<EditorWidgetBase*(EditorWidgetContainer&)> createCallback);
-
-	private:
-		/**	Triggered whenever a window gains focus. */
-		void onFocusGained(const RenderWindow& window);
-
-		/**	Triggered whenever a window loses focus. */
-		void onFocusLost(const RenderWindow& window);
-
-		Map<String, EditorWidgetBase*> mActiveWidgets;
-		Map<String, std::function<EditorWidgetBase*(EditorWidgetContainer&)>> mCreateCallbacks;
-
-		HEvent mOnFocusLostConn;
-		HEvent mOnFocusGainedConn;
-
-		static Stack<std::pair<String, std::function<EditorWidgetBase*(EditorWidgetContainer&)>>> QueuedCreateCallbacks;
-	};
-
-	/** @} */
-	/** @endcond */
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup EditorWindow
+	 *  @{
+	 */
+
+	/**
+	 * Handles opening and closing of EditorWidgets. Its primary purpose is to keep track of all types of widgets so they
+	 * can be saved and restored upon program shutdown/startup, as well as being able to change widget layout on the fly.
+	 */
+	class BS_ED_EXPORT EditorWidgetManager : public Module<EditorWidgetManager>
+	{
+	public:
+		EditorWidgetManager();
+		~EditorWidgetManager();
+
+		/**	Called every frame. */
+		void update();
+
+		/**
+		 * Registers a widget that can then be opened by calling open(). When loading a widget layout this name and callback
+		 * will be used to attempt creating the widget.
+		 *
+		 * @param[in]	name				  	Unique name for the widget.
+		 * @param[in]	createCallback			Callback that returns a new instance of the widget.
+		 */
+		void registerWidget(const String& name, std::function<EditorWidgetBase*(EditorWidgetContainer&)> createCallback);
+
+		/**	Unregisters a widget so it may no longer be opened using this manager. */
+		void unregisterWidget(const String& name);
+
+		/**
+		 * Creates a widget with the given name. If widget is already created it returns the existing instance.	Widget is
+		 * opened in a new window.
+		 *
+		 * @param[in]	name	The name of the widget.
+		 * @return				Always returns the created widget, and throws an exception if it fails.
+		 */
+		EditorWidgetBase* open(const String& name);
+
+		/**	Creates a new widget an inserts it into the specified container. */
+		EditorWidgetBase* create(const String& name, EditorWidgetContainer& parentContainer);
+
+		/**	Checks if the provided name represents a widget that can be created. */
+		bool isValidWidget(const String& name) const;
+
+		/**	Closes the given widget. */
+		void close(EditorWidgetBase* widget);
+
+		/**	Closes all open editor widgets. */
+		void closeAll();
+
+		/**
+		 * Retrieves the layout of all currently active widgets. You may later use this layout to restore exact position of
+		 * the widgets.
+		 */
+		EditorWidgetLayoutPtr getLayout() const;
+
+		/**
+		 * Positions all widgets according to the provided layout. It will open new widgets or close current ones if needed.
+		 */
+		void setLayout(const EditorWidgetLayoutPtr& layout);
+
+		/**
+		 * Allows you to queue up widgets that will be registered as soon as an instance of EditorWidgetManager is created.
+		 *
+		 * @note	
+		 * Useful primarily when widgets are being registered from static methods, because then there is no
+		 * EditorWidgetManager instance yet.
+		 */
+		static void preRegisterWidget(const String& name, std::function<EditorWidgetBase*(EditorWidgetContainer&)> createCallback);
+
+	private:
+		/**	Triggered whenever a window gains focus. */
+		void onFocusGained(const RenderWindow& window);
+
+		/**	Triggered whenever a window loses focus. */
+		void onFocusLost(const RenderWindow& window);
+
+		Map<String, EditorWidgetBase*> mActiveWidgets;
+		Map<String, std::function<EditorWidgetBase*(EditorWidgetContainer&)>> mCreateCallbacks;
+
+		HEvent mOnFocusLostConn;
+		HEvent mOnFocusGainedConn;
+
+		static Stack<std::pair<String, std::function<EditorWidgetBase*(EditorWidgetContainer&)>>> QueuedCreateCallbacks;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 1 - 1
Source/BansheeEditor/Source/Win32/BsVSCodeEditor.cpp

@@ -132,7 +132,7 @@ namespace BansheeEngine
 		 *
 		 * @param[in]	clsID			Class ID of the specific Visual Studio version we are looking for.
 		 * @param[in]	solutionPath	Path to the solution the instance needs to have open.
-		 * @returns						DTE object that may be used to interact with the Visual Studio instance, or null if
+		 * @return						DTE object that may be used to interact with the Visual Studio instance, or null if
 		 *								not found.
 		 */
 		static CComPtr<EnvDTE::_DTE> findRunningInstance(const CLSID& clsID, const Path& solutionPath)

+ 22 - 20
Source/SBansheeEditor/Include/BsEditorResourceLoader.h

@@ -1,21 +1,23 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsGameResourceManager.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Handles loading of game resources when the editor is running.
-	 */
-	class BS_SCR_BED_EXPORT EditorResourceLoader : public IGameResourceLoader
-	{
-	public:
-		/**
-		 * @copydoc	IGameResourceLoader::load
-		 */
-		HResource load(const Path& path, bool keepLoaded) const override;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsGameResourceManager.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Handles loading of game resources when the editor is running. */
+	class BS_SCR_BED_EXPORT EditorResourceLoader : public IGameResourceLoader
+	{
+	public:
+		/** @copydoc IGameResourceLoader::load */
+		HResource load(const Path& path, bool keepLoaded) const override;
+	};
+
+	/** @} */
 }

+ 35 - 36
Source/SBansheeEditor/Include/BsEditorScriptLibrary.h

@@ -1,37 +1,36 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsEngineScriptLibrary.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Handles initialization/shutdown of the script systems and 
-	 *			loading/refresh of engine and editor-specific assemblies.
-	 */
-	class BS_SCR_BED_EXPORT EditorScriptLibrary : public EngineScriptLibrary
-	{
-	public:
-		EditorScriptLibrary();
-
-		/**
-		 * @copydoc	ScriptLibrary::initialize
-		 */
-		void initialize() override;
-
-		/**
-		 * @copydoc	ScriptLibrary::reload
-		 */
-		void reload() override;
-
-		/**
-		 * @copydoc	ScriptLibrary::destroy
-		 */
-		void destroy() override;
-
-	private:
-		bool mScriptAssembliesLoaded;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsEngineScriptLibrary.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * Handles initialization/shutdown of the script systems and loading/refresh of engine and editor-specific assemblies.
+	 */
+	class BS_SCR_BED_EXPORT EditorScriptLibrary : public EngineScriptLibrary
+	{
+	public:
+		EditorScriptLibrary();
+
+		/** @copydoc ScriptLibrary::initialize */
+		void initialize() override;
+
+		/** @copydoc ScriptLibrary::reload */
+		void reload() override;
+
+		/** @copydoc ScriptLibrary::destroy */
+		void destroy() override;
+
+	private:
+		bool mScriptAssembliesLoaded;
+	};
+
+	/** @} */
 }

+ 57 - 60
Source/SBansheeEditor/Include/BsEditorScriptManager.h

@@ -1,61 +1,58 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Handles all editor script modules, updates editor windows and similar.
-	 */
-	class BS_SCR_BED_EXPORT EditorScriptManager : public Module<EditorScriptManager>
-	{
-	public:
-		EditorScriptManager();
-		~EditorScriptManager();
-
-		/**
-		 * @brief	Called every frame. Updates editor windows and script modules.
-		 *
-		 * @note	Internal method.
-		 */
-		void update();
-
-		/**
-		 * @brief	Called when the user requests the application to close.
-		 *
-		 * @note	Internal method.
-		 */
-		void quitRequested();
-
-	private:
-		/**
-		 * @brief	Triggers Program::OnInitialize callback. Should be called
-		 *			after startup and after assembly reload.
-		 */
-		void triggerOnInitialize();
-
-		/**
-		 * @brief	Triggered when an assembly refreshed finished.
-		 */
-		void onAssemblyRefreshDone();
-
-		/**
-		 * @brief	Loads all managed types and methods used by this module.
-		 */
-		void loadMonoTypes();
-
-		static const float EDITOR_UPDATE_RATE;
-
-		MonoAssembly* mEditorAssembly;
-		float mLastUpdateTime;
-
-		MonoClass* mProgramEdClass;
-		MonoMethod* mUpdateMethod;
-
-		HEvent mOnDomainLoadConn;
-		HEvent mOnAssemblyRefreshDoneConn;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Handles all editor script modules, updates editor windows and similar. */
+	class BS_SCR_BED_EXPORT EditorScriptManager : public Module<EditorScriptManager>
+	{
+	public:
+		EditorScriptManager();
+		~EditorScriptManager();
+
+		/**
+		 * Called every frame. Updates editor windows and script modules.
+		 *
+		 * @note	Internal method.
+		 */
+		void update();
+
+		/**
+		 * Called when the user requests the application to close.
+		 *
+		 * @note	Internal method.
+		 */
+		void quitRequested();
+
+	private:
+		/** Triggers Program::OnInitialize callback. Should be called after startup and after assembly reload. */
+		void triggerOnInitialize();
+
+		/**	Triggered when an assembly refreshed finished. */
+		void onAssemblyRefreshDone();
+
+		/**	Loads all managed types and methods used by this module. */
+		void loadMonoTypes();
+
+		static const float EDITOR_UPDATE_RATE;
+
+		MonoAssembly* mEditorAssembly;
+		float mLastUpdateTime;
+
+		MonoClass* mProgramEdClass;
+		MonoMethod* mUpdateMethod;
+
+		HEvent mOnDomainLoadConn;
+		HEvent mOnAssemblyRefreshDoneConn;
+	};
+
+	/** @} */
 }

+ 213 - 239
Source/SBansheeEditor/Include/BsGUIGameObjectField.h

@@ -1,240 +1,214 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsGUIElementContainer.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	GUI object that displays a field in which a GameObject can be dragged and dropped.
-	 *			The field accepts a GameObject of a specific type and displays an optional label.
-	 */
-	class BS_SCR_BED_EXPORT GUIGameObjectField : public GUIElementContainer
-	{
-		struct PrivatelyConstruct {};
-
-	public:
-		/**
-		 * Returns type name of the GUI element used for finding GUI element styles. 
-		 */
-		static const String& getGUITypeName();
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options, 
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field without a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIOptions& options, const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new game object GUI editor field without a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts.
-		 * @param	type			Type name of the type this field accepts. Must derive from GameObject.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const String& style = StringUtil::BLANK);
-
-		GUIGameObjectField(const PrivatelyConstruct& dummy, const String& typeNamespace, const String& type, const GUIContent& labelContent,
-			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
-
-		/**
-		 * @brief	Returns the game object currently referenced by the field, if any.
-		 */
-		HGameObject getValue() const;
-
-		/**
-		 * @brief	Sets the game object referenced by the field.
-		 */
-		void setValue(const HGameObject& value);
-
-		/**
-		 * @copydoc	GUIElement::setTint
-		 */
-		virtual void setTint(const Color& color) override;
-
-		/**
-		 * @copydoc	GUIElement::_updateLayoutInternal
-		 */
-		void _updateLayoutInternal(const GUILayoutData& data) override;
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		Vector2I _getOptimalSize() const override;
-
-		/**
-		 * @brief	Triggered whenever the referenced game object changes.
-		 */
-		Event<void(const HGameObject&)> onValueChanged;
-	private:
-		virtual ~GUIGameObjectField();
-
-		/**
-		 * @brief	Sets the game object referenced by the field.
-		 * 			
-		 * @param	value			Game object to reference.
-		 * @param	triggerEvent	Determines should the ::onValueChanged event be triggered if the new object is different 
-		 * 							from the previous one.
-		 */
-		void setValue(const HGameObject& value, bool triggerEvent);
-
-		/**
-		 * @copydoc	GUIElement::styleUpdated
-		 */
-		void styleUpdated() override;
-
-		/**
-		 * @brief	Triggered when a drag and drop operation finishes over this element.
-		 */
-		void dataDropped(void* data);
-
-		/**
-		 * @brief	Triggered when the drop button that displays the game object label is clicked.
-		 */
-		void onDropButtonClicked();
-
-		/**
-		 * @brief	Triggered when the clear button is clicked.
-		 */
-		void onClearButtonClicked();
-
-	private:
-		static const UINT32 DEFAULT_LABEL_WIDTH;
-
-		GUILayout* mLayout;
-		GUILabel* mLabel;
-		GUIDropButton* mDropButton;
-		GUIButton* mClearButton;
-		String mType;
-		String mNamespace;
-
-		UINT64 mInstanceId;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsGUIElementContainer.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * GUI object that displays a field in which a GameObject can be dragged and dropped. The field accepts a GameObject of
+	 * a specific type and displays an optional label.
+	 */
+	class BS_SCR_BED_EXPORT GUIGameObjectField : public GUIElementContainer
+	{
+		struct PrivatelyConstruct {};
+
+	public:
+		/** Returns type name of the GUI element used for finding GUI element styles. */
+		static const String& getGUITypeName();
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options, 
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field without a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIOptions& options, const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new game object GUI editor field without a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts.
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from GameObject.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIGameObjectField* create(const String& typeNamespace, const String& type, const String& style = StringUtil::BLANK);
+
+		GUIGameObjectField(const PrivatelyConstruct& dummy, const String& typeNamespace, const String& type, const GUIContent& labelContent,
+			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
+
+		/**	Returns the game object currently referenced by the field, if any. */
+		HGameObject getValue() const;
+
+		/**	Sets the game object referenced by the field. */
+		void setValue(const HGameObject& value);
+
+		/** @copydoc GUIElement::setTint */
+		virtual void setTint(const Color& color) override;
+
+		/** @copydoc GUIElement::_updateLayoutInternal */
+		void _updateLayoutInternal(const GUILayoutData& data) override;
+
+		/** @copydoc GUIElement::_getOptimalSize */
+		Vector2I _getOptimalSize() const override;
+
+		/**	Triggered whenever the referenced game object changes. */
+		Event<void(const HGameObject&)> onValueChanged;
+	private:
+		virtual ~GUIGameObjectField();
+
+		/**
+		 * Sets the game object referenced by the field.
+		 * 			
+		 * @param[in]	value			Game object to reference.
+		 * @param[in]	triggerEvent	Determines should the onValueChanged() event be triggered if the new object is
+		 *								different from the previous one.
+		 */
+		void setValue(const HGameObject& value, bool triggerEvent);
+
+		/** @copydoc GUIElement::styleUpdated */
+		void styleUpdated() override;
+
+		/**	Triggered when a drag and drop operation finishes over this element. */
+		void dataDropped(void* data);
+
+		/**	Triggered when the drop button that displays the game object label is clicked. */
+		void onDropButtonClicked();
+
+		/**	Triggered when the clear button is clicked. */
+		void onClearButtonClicked();
+
+	private:
+		static const UINT32 DEFAULT_LABEL_WIDTH;
+
+		GUILayout* mLayout;
+		GUILabel* mLabel;
+		GUIDropButton* mDropButton;
+		GUIButton* mClearButton;
+		String mType;
+		String mNamespace;
+
+		UINT64 mInstanceId;
+	};
+
+	/** @} */
 }

+ 224 - 256
Source/SBansheeEditor/Include/BsGUIResourceField.h

@@ -1,257 +1,225 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsGUIElementContainer.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	GUI object that displays a field in which a Resource can be dragged and dropped.
-	 *			The field accepts a Resource of a specific type and displays an optional label.
-	 */
-	class BS_SCR_BED_EXPORT GUIResourceField : public GUIElementContainer
-	{
-		struct PrivatelyConstruct {};
-
-	public:
-		/**
-		 * Returns type name of the GUI element used for finding GUI element styles. 
-		 */
-		static const String& getGUITypeName();
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field without a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIOptions& options, const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field with a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new resource GUI editor field without a label.
-		 *
-		 * @param	typeNamespace	Namespace of the type this field accepts. 
-		 * @param	type			Type name of the type this field accepts. Must derive from Resource.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIResourceField* create(const String& typeNamespace, const String& type, const String& style = StringUtil::BLANK);
-
-		GUIResourceField(const PrivatelyConstruct& dummy, const String& typeNamespace, const String& type, const GUIContent& labelContent,
-			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
-
-		/**
-		 * @brief	Returns the resource referenced by the field, if any.
-		 */
-		HResource getValue() const;
-
-		/**
-		 * @brief	Sets the resource referenced by the field.
-		 */
-		void setValue(const HResource& value);
-
-		/**
-		 * @brief	Returns a weak reference to the texture referenced by the field, if any.
-		 */
-		WeakResourceHandle<Resource> getValueWeak() const;
-
-		/**
-		 * @brief	Sets a weak reference to the texture referenced by the field.
-		 */
-		void setValueWeak(const WeakResourceHandle<Resource>& value);
-
-		/**
-		 * @brief	Returns the resource referenced by the field. Returns
-		 *			empty string with no resource is referenced.
-		 */
-		String getUUID() const { return mUUID; }
-
-		/**
-		 * @copydoc	GUIElement::setTint
-		 */
-		virtual void setTint(const Color& color) override;
-
-		/**
-		 * @copydoc	GUIElement::_updateLayoutInternal
-		 */
-		void _updateLayoutInternal(const GUILayoutData& data) override;
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		Vector2I _getOptimalSize() const override;
-
-		/**
-		 * @brief	Triggered whenever the referenced resource changes. Provides
-		 *			a weak handle of the resource, or empty handle if no resource is referenced.
-		 */
-		Event<void(const WeakResourceHandle<Resource>&)> onValueChanged;
-	private:
-		virtual ~GUIResourceField();
-
-		/**
-		 * @brief	Sets the resource referenced by the field by finding
-		 *			the resource with the provided UUID.
-		 *			
-		 * @param	uuid			Unique resource identifier of the resource to show, or empty string if no resource.
-		 * @param	triggerEvent	Determines should the ::onValueChanged event be triggered if the new UUID is different 
-		 * 							from the previous one.
-		 */
-		void setUUID(const String& uuid, bool triggerEvent = true);
-
-		/**
-		 * @copydoc	GUIElement::styleUpdated
-		 */
-		void styleUpdated() override;
-
-		/**
-		 * @brief	Triggered when a drag and drop operation finishes over this element.
-		 */
-		void dataDropped(void* data);
-
-		/**
-		 * @brief	Triggered when the drop button that displays the game object label is clicked.
-		 */
-		void onDropButtonClicked();
-
-		/**
-		 * @brief	Triggered when the clear button is clicked.
-		 */
-		void onClearButtonClicked();
-
-	private:
-		static const UINT32 DEFAULT_LABEL_WIDTH;
-
-		GUILayout* mLayout;
-		GUILabel* mLabel;
-		GUIDropButton* mDropButton;
-		GUIButton* mClearButton;
-		String mNamespace;
-		String mType;
-		String mUUID;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsGUIElementContainer.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * GUI object that displays a field in which a Resource can be dragged and dropped. The field accepts a Resource of a
+	 * specific type and displays an optional label.
+	 */
+	class BS_SCR_BED_EXPORT GUIResourceField : public GUIElementContainer
+	{
+		struct PrivatelyConstruct {};
+
+	public:
+		/** Returns type name of the GUI element used for finding GUI element styles. */
+		static const String& getGUITypeName();
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field without a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIOptions& options, const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field with a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const HString& labelText,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new resource GUI editor field without a label.
+		 *
+		 * @param[in]	typeNamespace	Namespace of the type this field accepts. 
+		 * @param[in]	type			Type name of the type this field accepts. Must derive from Resource.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUIResourceField* create(const String& typeNamespace, const String& type, const String& style = StringUtil::BLANK);
+
+		GUIResourceField(const PrivatelyConstruct& dummy, const String& typeNamespace, const String& type, const GUIContent& labelContent,
+			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
+
+		/**	Returns the resource referenced by the field, if any. */
+		HResource getValue() const;
+
+		/**	Sets the resource referenced by the field. */
+		void setValue(const HResource& value);
+
+		/**	Returns a weak reference to the texture referenced by the field, if any. */
+		WeakResourceHandle<Resource> getValueWeak() const;
+
+		/**	Sets a weak reference to the texture referenced by the field. */
+		void setValueWeak(const WeakResourceHandle<Resource>& value);
+
+		/** Returns the resource referenced by the field. Returns empty string with no resource is referenced. */
+		String getUUID() const { return mUUID; }
+
+		/** @copydoc GUIElement::setTint */
+		virtual void setTint(const Color& color) override;
+
+		/** @copydoc GUIElement::_updateLayoutInternal */
+		void _updateLayoutInternal(const GUILayoutData& data) override;
+
+		/** @copydoc GUIElement::_getOptimalSize */
+		Vector2I _getOptimalSize() const override;
+
+		/**
+		 * Triggered whenever the referenced resource changes. Provides	a weak handle of the resource, or empty handle if
+		 * no resource is referenced.
+		 */
+		Event<void(const WeakResourceHandle<Resource>&)> onValueChanged;
+	private:
+		virtual ~GUIResourceField();
+
+		/**
+		 * Sets the resource referenced by the field by finding the resource with the provided UUID.
+		 *			
+		 * @param[in]	uuid			Unique resource identifier of the resource to show, or empty string if no resource.
+		 * @param[in]	triggerEvent	Determines should the onValueChanged() event be triggered if the new UUID is
+		 *								different from the previous one.
+		 */
+		void setUUID(const String& uuid, bool triggerEvent = true);
+
+		/** @copydoc GUIElement::styleUpdated */
+		void styleUpdated() override;
+
+		/**	Triggered when a drag and drop operation finishes over this element. */
+		void dataDropped(void* data);
+
+		/**	Triggered when the drop button that displays the game object label is clicked. */
+		void onDropButtonClicked();
+
+		/**	Triggered when the clear button is clicked. */
+		void onClearButtonClicked();
+
+	private:
+		static const UINT32 DEFAULT_LABEL_WIDTH;
+
+		GUILayout* mLayout;
+		GUILabel* mLabel;
+		GUIDropButton* mDropButton;
+		GUIButton* mClearButton;
+		String mNamespace;
+		String mType;
+		String mUUID;
+	};
+
+	/** @} */
 }

+ 202 - 236
Source/SBansheeEditor/Include/BsGUITextureField.h

@@ -1,237 +1,203 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsGUIElementContainer.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	GUI object that displays a field in which a Texture can be dragged and dropped.
-	 *			The field accepts a Texture of a specific type and displays an optional label.
-	 *			If texture is referenced its image is displayed in the field.
-	 */
-	class BS_SCR_BED_EXPORT GUITextureField : public GUIElementContainer
-	{
-		struct PrivatelyConstruct {};
-
-	public:
-		/**
-		 * Returns type name of the GUI element used for finding GUI element styles. 
-		 */
-		static const String& getGUITypeName();
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const GUIContent& labelContent, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const HString& labelText, const GUIOptions& options,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field without a label.
-		 *
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const GUIOptions& options, const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelContent	Content to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const GUIContent& labelContent,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	labelWidth		Width of the label in pixels.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const HString& labelText, UINT32 labelWidth,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field with a label.
-		 *
-		 * @param	labelText		Text to display in the editor field label.
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const HString& labelText,
-			const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new texture GUI editor field without a label.
-		 *
-		 * @param	style			Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUITextureField* create(const String& style = StringUtil::BLANK);
-
-		GUITextureField(const PrivatelyConstruct& dummy, const GUIContent& labelContent,
-			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
-
-		/**
-		 * @brief	Returns the texture referenced by the field, if any. This will load the texture if it is not already
-		 * 			loaded.
-		 */
-		HTexture getValue() const;
-
-		/**
-		 * @brief	Sets the texture referenced by the field.
-		 */
-		void setValue(const HTexture& value);
-
-		/**
-		 * @brief	Returns a weak reference to the texture referenced by the field, if any.
-		 */
-		WeakResourceHandle<Texture> getValueWeak() const;
-
-		/**
-		 * @brief	Sets a weak reference to the texture referenced by the field.
-		 */
-		void setValueWeak(const WeakResourceHandle<Texture>& value);
-
-		/**
-		 * @brief	Returns the texture referenced by the field. Returns
-		 *			empty string with no texture is referenced.
-		 */
-		String getUUID() const { return mUUID; }
-
-		/**
-		 * @copydoc	GUIElement::setTint
-		 */
-		virtual void setTint(const Color& color) override;
-
-		/**
-		 * @copydoc	GUIElement::_updateLayoutInternal
-		 */
-		void _updateLayoutInternal(const GUILayoutData& data) override;
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		Vector2I _getOptimalSize() const override;
-
-		/**
-		 * @brief	Triggered whenever the referenced texture changes. Provides
-		 *			a weak handle to the resource, or empty handle if no texture is referenced.
-		 */
-		Event<void(const WeakResourceHandle<Texture>&)> onValueChanged;
-	private:
-		virtual ~GUITextureField();
-
-		/**
-		 * @copydoc	GUIElement::styleUpdated
-		 */
-		void styleUpdated() override;
-
-		/**
-		 * @brief	Sets the texture referenced by the field by finding
-		 *			the texture with the provided UUID.
-		 *			
-		 * @param	uuid			Unique resource identifier of the texture to show, or empty string if no texture.
-		 * @param	triggerEvent	Determines should the ::onValueChanged event be triggered if the new UUID is different 
-		 * 							from the previous one.
-		 */
-		void setUUID(const String& uuid, bool triggerEvent = true);
-
-		/**
-		 * @brief	Triggered when a drag and drop operation finishes over this element.
-		 */
-		void dataDropped(void* data);
-
-		/**
-		 * @brief	Triggered when the drop button that displays the game object label is clicked.
-		 */
-		void onDropButtonClicked();
-
-		/**
-		 * @brief	Triggered when the clear button is clicked.
-		 */
-		void onClearButtonClicked();
-
-	private:
-		static const UINT32 DEFAULT_LABEL_WIDTH;
-
-		GUILayout* mLayout;
-		GUILabel* mLabel;
-		GUIDropButton* mDropButton;
-		GUIButton* mClearButton;
-		String mUUID;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsGUIElementContainer.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * GUI object that displays a field in which a Texture can be dragged and dropped. The field accepts a Texture of a
+	 * specific type and displays an optional label. If texture is referenced its image is displayed in the field.
+	 */
+	class BS_SCR_BED_EXPORT GUITextureField : public GUIElementContainer
+	{
+		struct PrivatelyConstruct {};
+
+	public:
+		/** Returns type name of the GUI element used for finding GUI element styles. */
+		static const String& getGUITypeName();
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const GUIContent& labelContent, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const HString& labelText, const GUIOptions& options,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field without a label.
+		 *
+		 * @param[in]	options			Options that allow you to control how is the element positioned and sized. This will
+		 *								override any similar options set by style.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const GUIOptions& options, const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelContent	Content to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const GUIContent& labelContent,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	labelWidth		Width of the label in pixels.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const HString& labelText, UINT32 labelWidth,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field with a label.
+		 *
+		 * @param[in]	labelText		Text to display in the editor field label.
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const HString& labelText,
+			const String& style = StringUtil::BLANK);
+
+		/**
+		 * Creates a new texture GUI editor field without a label.
+		 *
+		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
+		 *								GUIWidget the element is used on. If not specified default style is used.
+		 */
+		static GUITextureField* create(const String& style = StringUtil::BLANK);
+
+		GUITextureField(const PrivatelyConstruct& dummy, const GUIContent& labelContent,
+			UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
+
+		/** Returns the texture referenced by the field, if any. This will load the texture if it is not already loaded. */
+		HTexture getValue() const;
+
+		/**	Sets the texture referenced by the field. */
+		void setValue(const HTexture& value);
+
+		/**	Returns a weak reference to the texture referenced by the field, if any. */
+		WeakResourceHandle<Texture> getValueWeak() const;
+
+		/**	Sets a weak reference to the texture referenced by the field. */
+		void setValueWeak(const WeakResourceHandle<Texture>& value);
+
+		/**	Returns the texture referenced by the field. Returns empty string with no texture is referenced. */
+		String getUUID() const { return mUUID; }
+
+		/** @copydoc GUIElement::setTint */
+		virtual void setTint(const Color& color) override;
+
+		/** @copydoc GUIElement::_updateLayoutInternal */
+		void _updateLayoutInternal(const GUILayoutData& data) override;
+
+		/** @copydoc GUIElement::_getOptimalSize */
+		Vector2I _getOptimalSize() const override;
+
+		/**
+		 * Triggered whenever the referenced texture changes. Provides a weak handle to the resource, or empty handle if no
+		 * texture is referenced.
+		 */
+		Event<void(const WeakResourceHandle<Texture>&)> onValueChanged;
+	private:
+		virtual ~GUITextureField();
+
+		/** @copydoc GUIElement::styleUpdated */
+		void styleUpdated() override;
+
+		/**
+		 * Sets the texture referenced by the field by finding the texture with the provided UUID.
+		 *			
+		 * @param[in]	uuid			Unique resource identifier of the texture to show, or empty string if no texture.
+		 * @param[in]	triggerEvent	Determines should the onValueChanged() event be triggered if the new UUID is
+		 *								different from the previous one.
+		 */
+		void setUUID(const String& uuid, bool triggerEvent = true);
+
+		/**	Triggered when a drag and drop operation finishes over this element. */
+		void dataDropped(void* data);
+
+		/**	Triggered when the drop button that displays the game object label is clicked. */
+		void onDropButtonClicked();
+
+		/**	Triggered when the clear button is clicked. */
+		void onClearButtonClicked();
+
+	private:
+		static const UINT32 DEFAULT_LABEL_WIDTH;
+
+		GUILayout* mLayout;
+		GUILabel* mLabel;
+		GUIDropButton* mDropButton;
+		GUIButton* mClearButton;
+		String mUUID;
+	};
+
+	/** @} */
 }

+ 62 - 64
Source/SBansheeEditor/Include/BsMenuItemManager.h

@@ -1,65 +1,63 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Tracks main menu items that are registered in managed code using the MenuItem
-	 *			attribute.
-	 */
-	class BS_SCR_BED_EXPORT MenuItemManager : public Module<MenuItemManager>
-	{
-	public:
-		MenuItemManager(ScriptAssemblyManager& scriptObjectManager);
-		~MenuItemManager();
-
-	private:
-		/**
-		 * @brief	Removes all managed menu items from the main menu.
-		 */
-		void clearMenuItems();
-
-		/**
-		 * @brief	Reloads all assembly types and attempts to find uses of MenuItem. Old
-		 *			menu items are cleared and new are added.
-		 */
-		void reloadAssemblyData();
-
-		/**
-		 * @brief	Parse the provided method and detect whether it has a MenuItem attribute.
-		 *			If it has extract needed data from it.
-		 *
-		 * @param	method		Managed method to parse.
-		 * @param	path		Output path defined in the MenuItem attribute.
-		 * @param	shortcut	Shortcut key defined in the MenuItem attribute.
-		 * @param	priority	Menu item priority defined in the MenuItem attribute.
-		 * @param	separator	Should the separator be inserted before the menu item.
-		 *
-		 * @return	True if the method has a MenuItem attribute. If false is returned output parameters
-		 *			from this method are undefined.
-		 */
-		bool parseMenuItemMethod(MonoMethod* method, WString& path, ShortcutKey& shortcut, INT32& priority, bool& separator) const;
-
-		/**
-		 * @brief	Triggered when one of the managed menu items is clicked. 
-		 *
-		 * @param	method	Managed method that the MenuItem is referencing.
-		 */
-		static void menuItemCallback(MonoMethod* method);
-
-		ScriptAssemblyManager& mScriptObjectManager;
-		HEvent mDomainLoadedConn;
-
-		MonoClass* mMenuItemAttribute;
-		MonoField* mPathField;
-		MonoField* mShortcutField;
-		MonoField* mPriorityField;
-		MonoField* mSeparatorField;
-
-		Vector<GUIMenuItem*> mMenuItems;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Tracks main menu items that are registered in managed code using the MenuItem attribute. */
+	class BS_SCR_BED_EXPORT MenuItemManager : public Module<MenuItemManager>
+	{
+	public:
+		MenuItemManager(ScriptAssemblyManager& scriptObjectManager);
+		~MenuItemManager();
+
+	private:
+		/**	Removes all managed menu items from the main menu. */
+		void clearMenuItems();
+
+		/**
+		 * Reloads all assembly types and attempts to find uses of MenuItem. Old menu items are cleared and new are added.
+		 */
+		void reloadAssemblyData();
+
+		/**
+		 * Parse the provided method and detect whether it has a MenuItem attribute. If it has extract needed data from it.
+		 *
+		 * @param[in]	method		Managed method to parse.
+		 * @param[in]	path		Output path defined in the MenuItem attribute.
+		 * @param[in]	shortcut	Shortcut key defined in the MenuItem attribute.
+		 * @param[in]	priority	Menu item priority defined in the MenuItem attribute.
+		 * @param[in]	separator	Should the separator be inserted before the menu item.
+		 * @return					True if the method has a MenuItem attribute. If false is returned output parameters
+		 *							from this method are undefined.
+		 */
+		bool parseMenuItemMethod(MonoMethod* method, WString& path, ShortcutKey& shortcut, INT32& priority, bool& separator) const;
+
+		/**
+		 * Triggered when one of the managed menu items is clicked. 
+		 *
+		 * @param[in]	method	Managed method that the MenuItem is referencing.
+		 */
+		static void menuItemCallback(MonoMethod* method);
+
+		ScriptAssemblyManager& mScriptObjectManager;
+		HEvent mDomainLoadedConn;
+
+		MonoClass* mMenuItemAttribute;
+		MonoField* mPathField;
+		MonoField* mShortcutField;
+		MonoField* mPriorityField;
+		MonoField* mSeparatorField;
+
+		Vector<GUIMenuItem*> mMenuItems;
+	};
+
+	/** @} */
 }

+ 31 - 26
Source/SBansheeEditor/Include/BsScriptBrowseDialog.h

@@ -1,27 +1,32 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for browse dialog methods in Platform.
-	 */
-	class BS_SCR_BED_EXPORT ScriptBrowseDialog : public ScriptObject<ScriptBrowseDialog>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "BrowseDialog")
-
-	private:
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static bool internal_OpenFile(MonoString* defaultFolder, MonoString* filterList, bool allowMultiselect, MonoArray** outPaths);
-		static bool internal_OpenFolder(MonoString* defaultFolder, MonoString** outPath);
-		static bool internal_SaveFile(MonoString* defaultFolder, MonoString* filterList, MonoString** outPath);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for browse dialog methods in Platform. */
+	class BS_SCR_BED_EXPORT ScriptBrowseDialog : public ScriptObject<ScriptBrowseDialog>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "BrowseDialog")
+
+	private:
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static bool internal_OpenFile(MonoString* defaultFolder, MonoString* filterList, bool allowMultiselect, 
+			MonoArray** outPaths);
+		static bool internal_OpenFolder(MonoString* defaultFolder, MonoString** outPath);
+		static bool internal_SaveFile(MonoString* defaultFolder, MonoString* filterList, MonoString** outPath);
+	};
+
+	/** @} */
 }

+ 55 - 53
Source/SBansheeEditor/Include/BsScriptBuildManager.h

@@ -1,54 +1,56 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsBuildManager.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Types of various folders used by the managed build manager.
-	 */
-	enum class ScriptBuildFolder
-	{
-		SourceRoot, /**< Absolute path to the root folder where all the prebuilt binaries and data exist. */
-		DestinationRoot, /**< Absolute path to the root folder for a build for a specific platform. */
-		NativeBinaries, /**< Folder where native binaries are stored. Relative to root. */
-		BansheeDebugAssemblies, /**< Folder where Banshee specific debug assemblies are stored. Relative to root. */
-		BansheeReleaseAssemblies, /**< Folder where Banshee specific release assemblies are stored. Relative to root. */
-		FrameworkAssemblies, /**< Folder where .NET framework assemblies are stored. Relative to root. */
-		Mono, /**< Folder where miscelaneous Mono files are stored. Relative to root. */
-		Data /**< Folder where builtin data is stored. Relative to root. */
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for BuildManager.
-	 */
-	class BS_SCR_BED_EXPORT ScriptBuildManager : public ScriptObject <ScriptBuildManager>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "BuildManager")
-
-	private:
-		ScriptBuildManager(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoArray* internal_GetAvailablePlatforms();
-		static PlatformType internal_GetActivePlatform();
-		static void internal_SetActivePlatform(PlatformType value);
-		static MonoObject* internal_GetActivePlatformInfo();
-		static MonoObject* internal_GetPlatformInfo(PlatformType type);
-		static MonoArray* internal_GetFrameworkAssemblies(PlatformType type);
-		static MonoString* internal_GetMainExecutable(PlatformType type);
-		static MonoString* internal_GetDefines(PlatformType type);
-		static MonoArray* internal_GetNativeBinaries(PlatformType type);
-		static MonoString* internal_GetBuildFolder(ScriptBuildFolder folder, PlatformType platform);
-		static void internal_InjectIcons(MonoString* filePath, ScriptPlatformInfo* info);
-		static void internal_PackageResources(MonoString* buildFolder, ScriptPlatformInfo* info);
-		static void internal_CreateStartupSettings(MonoString* buildFolder, ScriptPlatformInfo* info);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsBuildManager.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Types of various folders used by the managed build manager. */
+	enum class ScriptBuildFolder
+	{
+		SourceRoot, /**< Absolute path to the root folder where all the prebuilt binaries and data exist. */
+		DestinationRoot, /**< Absolute path to the root folder for a build for a specific platform. */
+		NativeBinaries, /**< Folder where native binaries are stored. Relative to root. */
+		BansheeDebugAssemblies, /**< Folder where Banshee specific debug assemblies are stored. Relative to root. */
+		BansheeReleaseAssemblies, /**< Folder where Banshee specific release assemblies are stored. Relative to root. */
+		FrameworkAssemblies, /**< Folder where .NET framework assemblies are stored. Relative to root. */
+		Mono, /**< Folder where miscelaneous Mono files are stored. Relative to root. */
+		Data /**< Folder where builtin data is stored. Relative to root. */
+	};
+
+	/**	Interop class between C++ & CLR for BuildManager. */
+	class BS_SCR_BED_EXPORT ScriptBuildManager : public ScriptObject <ScriptBuildManager>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "BuildManager")
+
+	private:
+		ScriptBuildManager(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoArray* internal_GetAvailablePlatforms();
+		static PlatformType internal_GetActivePlatform();
+		static void internal_SetActivePlatform(PlatformType value);
+		static MonoObject* internal_GetActivePlatformInfo();
+		static MonoObject* internal_GetPlatformInfo(PlatformType type);
+		static MonoArray* internal_GetFrameworkAssemblies(PlatformType type);
+		static MonoString* internal_GetMainExecutable(PlatformType type);
+		static MonoString* internal_GetDefines(PlatformType type);
+		static MonoArray* internal_GetNativeBinaries(PlatformType type);
+		static MonoString* internal_GetBuildFolder(ScriptBuildFolder folder, PlatformType platform);
+		static void internal_InjectIcons(MonoString* filePath, ScriptPlatformInfo* info);
+		static void internal_PackageResources(MonoString* buildFolder, ScriptPlatformInfo* info);
+		static void internal_CreateStartupSettings(MonoString* buildFolder, ScriptPlatformInfo* info);
+	};
+
+	/** @} */
 }

+ 33 - 29
Source/SBansheeEditor/Include/BsScriptCodeEditor.h

@@ -1,30 +1,34 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for CodeEditorManager.
-	 */
-	class BS_SCR_BED_EXPORT ScriptCodeEditor : public ScriptObject<ScriptCodeEditor>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "CodeEditor")
-
-	private:
-		ScriptCodeEditor(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_SetActiveEditor(CodeEditorType type);
-		static CodeEditorType internal_GetActiveEditor();
-		static MonoArray* internal_GetAvailableEditors();
-		static void internal_OpenFile(MonoString* path, UINT32 line);
-		static void internal_SyncSolution();
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for CodeEditorManager. */
+	class BS_SCR_BED_EXPORT ScriptCodeEditor : public ScriptObject<ScriptCodeEditor>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "CodeEditor")
+
+	private:
+		ScriptCodeEditor(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_SetActiveEditor(CodeEditorType type);
+		static CodeEditorType internal_GetActiveEditor();
+		static MonoArray* internal_GetAvailableEditors();
+		static void internal_OpenFile(MonoString* path, UINT32 line);
+		static void internal_SyncSolution();
+	};
+
+	/** @} */
 }

+ 166 - 176
Source/SBansheeEditor/Include/BsScriptDragDropManager.h

@@ -1,177 +1,167 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsDragAndDropManager.h"
-
-namespace BansheeEngine
-{
-	class ScriptSceneObjectDragDropData;
-	class ScriptResourceDragDropData;
-
-	/**
-	 * @brief	Types of drag and drop operations supported
-	 *			by the managed drag and drop system.
-	 */
-	// Note: Must be equal to C# DragDropType enum
-	enum class ScriptDragDropType
-	{
-		Resource,
-		SceneObject,
-		None
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for DragAndDropManager.
-	 */
-	class BS_SCR_BED_EXPORT ScriptDragDrop : public ScriptObject<ScriptDragDrop>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DragDrop");
-
-	private:
-		ScriptDragDrop(MonoObject* instance);
-
-		/**
-		 * @brief	Triggered when the scene object drag and drop operation ends.
-		 *
-		 * @param	processed	True if the drop operations was accepted by some system.
-		 */
-		static void sceneObjectDragDropFinalize(bool processed);
-
-		/**
-		 * @brief	Triggered when the resource drag and drop operation ends.
-		 *
-		 * @param	processed	True if the drop operations was accepted by some system.
-		 */
-		static void resourceDragDropFinalize(bool processed);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static bool internal_IsDragInProgress();
-		static bool internal_IsDropInProgress();
-		static MonoObject* internal_GetData();
-		static ScriptDragDropType internal_GetDragType();
-		static void internal_StartSceneObjectDrag(ScriptSceneObjectDragDropData* dragData);
-		static void internal_StartResourceDrag(ScriptResourceDragDropData* dragData);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for SceneObjectDragDropData. Contains
-	 *			a set of scene objects used during managed drag and drop operations.
-	 */
-	class BS_SCR_BED_EXPORT ScriptSceneObjectDragDropData : public ScriptObject<ScriptSceneObjectDragDropData>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneObjectDragDropData");
-
-		/**
-		 * @brief	Creates a new managed instance of SceneObjectDragDropData containing
-		 *			the specified scene objects.
-		 */
-		static MonoObject* create(const Vector<HSceneObject>& sceneObjects);
-
-		/**
-		 * @brief	Returns the scene objects referenced by this object.
-		 */
-		const Vector<HSceneObject>& getSceneObjects() const { return mSceneObjects; }
-
-	private:
-		ScriptSceneObjectDragDropData(MonoObject* instance, const Vector<HSceneObject>& sceneObjects);
-
-		Vector<HSceneObject> mSceneObjects;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, MonoArray* objects);
-		static MonoArray* internal_GetObjects(ScriptSceneObjectDragDropData* instance);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ResourceDragDropData. Contains
-	 *			a set of resource paths used during managed drag and drop operations.
-	 */
-	class BS_SCR_BED_EXPORT ScriptResourceDragDropData : public ScriptObject < ScriptResourceDragDropData >
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ResourceDragDropData");
-
-		/**
-		 * @brief	Creates a new managed instance of ResourceDragDropData containing
-		 *			the specified resource paths.
-		 */
-		static MonoObject* create(const Vector<Path>& paths);
-
-		/**
-		 * @brief	Returns the resource paths referenced by this object.
-		 */
-		const Vector<Path>& getPaths() const { return mPaths; }
-
-	private:
-		ScriptResourceDragDropData(MonoObject* instance, const Vector<Path>& paths);
-
-		Vector<Path> mPaths;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, MonoArray* paths);
-		static MonoArray* internal_GetPaths(ScriptResourceDragDropData* instance);
-	};
-
-	/**
-	 * @brief	Handles managed drag and drop operations. Wraps the existing
-	 *			functionality of DragAndDropManager. Essentially converts the
-	 *			callback nature of DragAndDropManager into a polling based system.
-	 */
-	class BS_SCR_BED_EXPORT ScriptDragDropManager : public Module<ScriptDragDropManager>
-	{
-	public:
-		ScriptDragDropManager();
-		~ScriptDragDropManager();
-
-		/**
-		 * @brief	Called every frame. Checks for changes in drag and drop operations.
-		 *
-		 * @note	Internal method.
-		 */
-		void update();
-
-		/**
-		 * @brief	Checks has the user performed a drop operation this frame. 
-		 */
-		bool isDropInProgress() const { return mIsDropInProgress; }
-
-		/**
-		 * @brief	Returns the managed representation of currently dragged data (e.g. SceneObjectDragDropData). 
-		 *			This will be null if drag or drop is not in progress or of unsupported type.
-		 */
-		MonoObject* getDropData() const;
-
-		/**
-		 * @brief	Checks the type of the current drag or drop operation.
-		 */
-		ScriptDragDropType getDragType() const;
-
-	private:
-		/**
-		 * @brief	Triggered when a native drag and drop operation ends.
-		 *
-		 * @param	evt				Pointer data regarding where the drop operation occurred.
-		 * @param	callbackInfo	Data whether the drop was processed or not.
-		 */
-		void onMouseDragEnded(const PointerEvent& evt, DragCallbackInfo& callbackInfo);
-
-		HEvent mDragEndedConn;
-
-		bool mIsDropInProgress;
-		UINT64 mDroppedFrameIdx;
-		ScriptDragDropType mDropType;
-		Vector<Path> mDroppedPaths;
-		Vector<HSceneObject> mDroppedSceneObjects;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsDragAndDropManager.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	class ScriptSceneObjectDragDropData;
+	class ScriptResourceDragDropData;
+
+	/** Types of drag and drop operations supported by the managed drag and drop system. */
+	enum class ScriptDragDropType // Note: Must be equal to C# DragDropType enum
+	{
+		Resource,
+		SceneObject,
+		None
+	};
+
+	/**	Interop class between C++ & CLR for DragAndDropManager. */
+	class BS_SCR_BED_EXPORT ScriptDragDrop : public ScriptObject<ScriptDragDrop>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DragDrop");
+
+	private:
+		ScriptDragDrop(MonoObject* instance);
+
+		/**
+		 * Triggered when the scene object drag and drop operation ends.
+		 *
+		 * @param[in]	processed	True if the drop operations was accepted by some system.
+		 */
+		static void sceneObjectDragDropFinalize(bool processed);
+
+		/**
+		 * Triggered when the resource drag and drop operation ends.
+		 *
+		 * @param[in]	processed	True if the drop operations was accepted by some system.
+		 */
+		static void resourceDragDropFinalize(bool processed);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static bool internal_IsDragInProgress();
+		static bool internal_IsDropInProgress();
+		static MonoObject* internal_GetData();
+		static ScriptDragDropType internal_GetDragType();
+		static void internal_StartSceneObjectDrag(ScriptSceneObjectDragDropData* dragData);
+		static void internal_StartResourceDrag(ScriptResourceDragDropData* dragData);
+	};
+
+	/**
+	 * Interop class between C++ & CLR for SceneObjectDragDropData. Contains a set of scene objects used during managed drag
+	 * and drop operations.
+	 */
+	class BS_SCR_BED_EXPORT ScriptSceneObjectDragDropData : public ScriptObject<ScriptSceneObjectDragDropData>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneObjectDragDropData");
+
+		/** Creates a new managed instance of SceneObjectDragDropData containing the specified scene objects. */
+		static MonoObject* create(const Vector<HSceneObject>& sceneObjects);
+
+		/**	Returns the scene objects referenced by this object. */
+		const Vector<HSceneObject>& getSceneObjects() const { return mSceneObjects; }
+
+	private:
+		ScriptSceneObjectDragDropData(MonoObject* instance, const Vector<HSceneObject>& sceneObjects);
+
+		Vector<HSceneObject> mSceneObjects;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, MonoArray* objects);
+		static MonoArray* internal_GetObjects(ScriptSceneObjectDragDropData* instance);
+	};
+
+	/**
+	 * Interop class between C++ & CLR for ResourceDragDropData. Contains a set of resource paths used during managed drag
+	 * and drop operations.
+	 */
+	class BS_SCR_BED_EXPORT ScriptResourceDragDropData : public ScriptObject < ScriptResourceDragDropData >
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ResourceDragDropData");
+
+		/**	Creates a new managed instance of ResourceDragDropData containing the specified resource paths. */
+		static MonoObject* create(const Vector<Path>& paths);
+
+		/**	Returns the resource paths referenced by this object. */
+		const Vector<Path>& getPaths() const { return mPaths; }
+
+	private:
+		ScriptResourceDragDropData(MonoObject* instance, const Vector<Path>& paths);
+
+		Vector<Path> mPaths;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, MonoArray* paths);
+		static MonoArray* internal_GetPaths(ScriptResourceDragDropData* instance);
+	};
+
+	/** @} */
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * Handles managed drag and drop operations. Wraps the existing functionality of DragAndDropManager. Essentially
+	 * converts the callback nature of DragAndDropManager into a polling based system.
+	 */
+	class BS_SCR_BED_EXPORT ScriptDragDropManager : public Module<ScriptDragDropManager>
+	{
+	public:
+		ScriptDragDropManager();
+		~ScriptDragDropManager();
+
+		/**
+		 * Called every frame. Checks for changes in drag and drop operations.
+		 *
+		 * @note	Internal method.
+		 */
+		void update();
+
+		/**	Checks has the user performed a drop operation this frame.  */
+		bool isDropInProgress() const { return mIsDropInProgress; }
+
+		/**
+		 * Returns the managed representation of currently dragged data (e.g. SceneObjectDragDropData). This will be null if
+		 * drag or drop is not in progress or of unsupported type.
+		 */
+		MonoObject* getDropData() const;
+
+		/**	Checks the type of the current drag or drop operation. */
+		ScriptDragDropType getDragType() const;
+
+	private:
+		/**
+		 * Triggered when a native drag and drop operation ends.
+		 *
+		 * @param[in]	evt				Pointer data regarding where the drop operation occurred.
+		 * @param[in]	callbackInfo	Data whether the drop was processed or not.
+		 */
+		void onMouseDragEnded(const PointerEvent& evt, DragCallbackInfo& callbackInfo);
+
+		HEvent mDragEndedConn;
+
+		bool mIsDropInProgress;
+		UINT64 mDroppedFrameIdx;
+		ScriptDragDropType mDropType;
+		Vector<Path> mDroppedPaths;
+		Vector<HSceneObject> mDroppedSceneObjects;
+	};
+
+	/** @} */
 }

+ 108 - 122
Source/SBansheeEditor/Include/BsScriptDropDownWindow.h

@@ -1,123 +1,109 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsDropDownWindow.h"
-#include "BsVector2I.h"
-
-namespace BansheeEngine
-{
-	class ManagedDropDownWindow;
-
-	/**
-	 * @brief	Interop class between C++ & CLR for types deriving from DropDownWindow.
-	 */
-	class BS_SCR_BED_EXPORT ScriptDropDownWindow : public ScriptObject <ScriptDropDownWindow>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DropDownWindow")
-
-		~ScriptDropDownWindow();
-
-	private:
-		friend class ManagedDropDownWindow;
-
-		ScriptDropDownWindow(ManagedDropDownWindow* window);
-
-		/**
-		 * @brief	Triggered when the assembly refresh starts.
-		 */
-		void onAssemblyRefreshStarted();
-
-		/**
-		 * @brief	Triggered when the native DropDownWindow wrapped by this object
-		 *			gets closed.
-		 */
-		void notifyWindowClosed();
-
-		ManagedDropDownWindow* mDropDownWindow;
-		HEvent mOnAssemblyRefreshStartedConn;
-
-		static MonoField* guiPanelField;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* parentWindow, Vector2I* position, int width, int height);
-		static void internal_Close(ScriptDropDownWindow* nativeInstance);
-		static void internal_SetWidth(ScriptDropDownWindow* nativeInstance, UINT32 value);
-		static void internal_SetHeight(ScriptDropDownWindow* nativeInstance, UINT32 value);
-		static void internal_ScreenToWindowPos(ScriptDropDownWindow* nativeInstance, Vector2I* position, Vector2I* windowPos);
-		static void internal_WindowToScreenPos(ScriptDropDownWindow* nativeInstance, Vector2I* position, Vector2I* screenPos);
-	};
-
-	/**
-	 * @brief	Managed implementation of a DropDownWindow. All managed drop down windows
-	 *			are implemented using this class, and the managed instance contains the
-	 *			specifics of each implementation.
-	 */
-	class BS_SCR_BED_EXPORT ManagedDropDownWindow : public DropDownWindow
-	{
-	public:
-		ManagedDropDownWindow(const RenderWindowPtr& parent, const CameraPtr& camera,
-			const Vector2I& position, MonoObject* managedInstance, UINT32 width, UINT32 height);
-		~ManagedDropDownWindow();
-
-		/**
-		 * @brief	Initializes the drop down window with the interop object that owns 
-		 *			the managed instance of this window
-		 */
-		void initialize(ScriptDropDownWindow* parent);
-
-		/**
-		 * @brief	Called every frame. Triggers OnEditorUpdate method on the managed object.
-		 */
-		void update() override;
-
-		/**
-		 * @brief	Trigger the OnInitialize method on the managed object.
-		 */
-		void triggerOnInitialize();
-
-		/**
-		 * @brief	Trigger the OnDestroy method on the managed object.
-		 */
-		void triggerOnDestroy();
-
-		/**
-		 * @brief	Returns the managed instance of the drop down window implementation.
-		 */
-		MonoObject* getManagedInstance() const { return mManagedInstance; }
-
-		/**
-		 * @brief	Reloads all the managed types and methods. Usually called right after
-		 *			construction or after assembly reload.
-		 *
-		 * @param	windowClass	Managed class of the drop down window to retrieve the data for.
-		 */
-		void reloadMonoTypes(MonoClass* windowClass);
-
-	private:
-		friend class ScriptModalWindow;
-
-		typedef void(__stdcall *OnInitializeThunkDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *OnDestroyThunkDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *UpdateThunkDef) (MonoObject*, MonoException**);
-
-		String mNamespace;
-		String mTypename;
-
-		OnInitializeThunkDef mOnInitializeThunk;
-		OnDestroyThunkDef mOnDestroyThunk;
-		UpdateThunkDef mUpdateThunk;
-
-		bool mIsInitialized;
-		MonoObject* mManagedInstance;
-		uint32_t mGCHandle;
-
-		ScriptDropDownWindow* mScriptParent;
-		ScriptGUILayout* mContentsPanel;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsDropDownWindow.h"
+#include "BsVector2I.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	class ManagedDropDownWindow;
+
+	/**	Interop class between C++ & CLR for types deriving from DropDownWindow. */
+	class BS_SCR_BED_EXPORT ScriptDropDownWindow : public ScriptObject <ScriptDropDownWindow>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DropDownWindow")
+
+		~ScriptDropDownWindow();
+
+	private:
+		friend class ManagedDropDownWindow;
+
+		ScriptDropDownWindow(ManagedDropDownWindow* window);
+
+		/**	Triggered when the assembly refresh starts. */
+		void onAssemblyRefreshStarted();
+
+		/**	Triggered when the native DropDownWindow wrapped by this object gets closed. */
+		void notifyWindowClosed();
+
+		ManagedDropDownWindow* mDropDownWindow;
+		HEvent mOnAssemblyRefreshStartedConn;
+
+		static MonoField* guiPanelField;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* parentWindow, Vector2I* position, int width, int height);
+		static void internal_Close(ScriptDropDownWindow* nativeInstance);
+		static void internal_SetWidth(ScriptDropDownWindow* nativeInstance, UINT32 value);
+		static void internal_SetHeight(ScriptDropDownWindow* nativeInstance, UINT32 value);
+		static void internal_ScreenToWindowPos(ScriptDropDownWindow* nativeInstance, Vector2I* position, Vector2I* windowPos);
+		static void internal_WindowToScreenPos(ScriptDropDownWindow* nativeInstance, Vector2I* position, Vector2I* screenPos);
+	};
+
+	/**
+	 * Managed implementation of a DropDownWindow. All managed drop down windows are implemented using this class, and the
+	 * managed instance contains the specifics of each implementation.
+	 */
+	class BS_SCR_BED_EXPORT ManagedDropDownWindow : public DropDownWindow
+	{
+	public:
+		ManagedDropDownWindow(const RenderWindowPtr& parent, const CameraPtr& camera,
+			const Vector2I& position, MonoObject* managedInstance, UINT32 width, UINT32 height);
+		~ManagedDropDownWindow();
+
+		/** Initializes the drop down window with the interop object that owns the managed instance of this window. */
+		void initialize(ScriptDropDownWindow* parent);
+
+		/**	Called every frame. Triggers OnEditorUpdate method on the managed object. */
+		void update() override;
+
+		/**	Trigger the OnInitialize method on the managed object. */
+		void triggerOnInitialize();
+
+		/**	Trigger the OnDestroy method on the managed object. */
+		void triggerOnDestroy();
+
+		/**	Returns the managed instance of the drop down window implementation. */
+		MonoObject* getManagedInstance() const { return mManagedInstance; }
+
+		/**
+		 * Reloads all the managed types and methods. Usually called right after construction or after assembly reload.
+		 *
+		 * @param[in]	windowClass	Managed class of the drop down window to retrieve the data for.
+		 */
+		void reloadMonoTypes(MonoClass* windowClass);
+
+	private:
+		friend class ScriptModalWindow;
+
+		typedef void(__stdcall *OnInitializeThunkDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *OnDestroyThunkDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *UpdateThunkDef) (MonoObject*, MonoException**);
+
+		String mNamespace;
+		String mTypename;
+
+		OnInitializeThunkDef mOnInitializeThunk;
+		OnDestroyThunkDef mOnDestroyThunk;
+		UpdateThunkDef mUpdateThunk;
+
+		bool mIsInitialized;
+		MonoObject* mManagedInstance;
+		uint32_t mGCHandle;
+
+		ScriptDropDownWindow* mScriptParent;
+		ScriptGUILayout* mContentsPanel;
+	};
+
+	/** @} */
 }

+ 84 - 88
Source/SBansheeEditor/Include/BsScriptEditorApplication.h

@@ -1,89 +1,85 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for EditorApplication.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorApplication : public ScriptObject <ScriptEditorApplication>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorApplication")
-
-		/**
-		 * @brief	Registers internal callbacks. Must be called on scripting system load.
-		 */
-		static void startUp();
-
-		/**
-		 * @brief	Unregisters internal callbacks. Must be called on scripting system shutdown.
-		 */
-		static void shutDown();
-
-		/**
-		 * @brief	Called every frame. Triggers delayed project load.
-		 */
-		 static void update();
-
-	private:
-		ScriptEditorApplication(MonoObject* instance);
-
-		/**
-		 * @brief	Triggered when the user clicks on the editor's status bar.
-		 */
-		static void onStatusBarClicked();
-
-		static bool mRequestProjectLoad;
-		static bool mRequestAssemblyReload;
-		static Path mProjectLoadPath;
-		static HEvent OnStatusBarClickedConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_SetStatusScene(MonoString* name, bool modified);
-		static void internal_SetStatusProject(bool modified);
-		static void internal_SetStatusCompiling(bool compiling);
-		static MonoString* internal_GetProjectPath();
-		static MonoString* internal_GetProjectName();
-		static bool internal_GetProjectLoaded();
-		static MonoString* internal_GetCompilerPath();
-		static MonoString* internal_GetBuiltinReleaseAssemblyPath();
-		static MonoString* internal_GetBuiltinDebugAssemblyPath();
-		static MonoString* internal_GetScriptAssemblyPath();
-		static MonoString* internal_GetFrameworkAssemblyPath();
-		static MonoString* internal_GetEngineAssemblyName();
-		static MonoString* internal_GetEditorAssemblyName();
-		static MonoString* internal_GetScriptGameAssemblyName();
-		static MonoString* internal_GetScriptEditorAssemblyName();
-		static MonoObject* internal_SaveScene(MonoString* path);
-		static bool internal_IsValidProject(MonoString* path);
-		static void internal_SaveProject();
-		static void internal_LoadProject(MonoString* path);
-		static void internal_UnloadProject();
-		static void internal_CreateProject(MonoString* path);
-		static void internal_ReloadAssemblies();
-		static void internal_OpenExternally(MonoString* path);
-		static void internal_RunUnitTests();
-		static void internal_Quit();
-		static void internal_ToggleToolbarItem(MonoString* name, bool on);
-		static bool internal_GetIsPlaying();
-		static void internal_SetIsPlaying(bool value);
-		static bool internal_GetIsPaused();
-		static void internal_SetIsPaused(bool value);
-		static void internal_FrameStep();
-		static void internal_SetMainRenderTarget(ScriptRenderTarget* renderTarget);
-		static bool internal_HasFocus();
-
-		typedef void(__stdcall *OnProjectLoadedThunkDef)(MonoException**);
-		typedef void(__stdcall *OnStatusBarClickedThunkDef) (MonoException**);
-
-		static OnProjectLoadedThunkDef onProjectLoadedThunk;
-		static OnStatusBarClickedThunkDef onStatusBarClickedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for EditorApplication. */
+	class BS_SCR_BED_EXPORT ScriptEditorApplication : public ScriptObject <ScriptEditorApplication>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorApplication")
+
+		/**	Registers internal callbacks. Must be called on scripting system load. */
+		static void startUp();
+
+		/**	Unregisters internal callbacks. Must be called on scripting system shutdown. */
+		static void shutDown();
+
+		/**	Called every frame. Triggers delayed project load. */
+		 static void update();
+
+	private:
+		ScriptEditorApplication(MonoObject* instance);
+
+		/**	Triggered when the user clicks on the editor's status bar. */
+		static void onStatusBarClicked();
+
+		static bool mRequestProjectLoad;
+		static bool mRequestAssemblyReload;
+		static Path mProjectLoadPath;
+		static HEvent OnStatusBarClickedConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_SetStatusScene(MonoString* name, bool modified);
+		static void internal_SetStatusProject(bool modified);
+		static void internal_SetStatusCompiling(bool compiling);
+		static MonoString* internal_GetProjectPath();
+		static MonoString* internal_GetProjectName();
+		static bool internal_GetProjectLoaded();
+		static MonoString* internal_GetCompilerPath();
+		static MonoString* internal_GetBuiltinReleaseAssemblyPath();
+		static MonoString* internal_GetBuiltinDebugAssemblyPath();
+		static MonoString* internal_GetScriptAssemblyPath();
+		static MonoString* internal_GetFrameworkAssemblyPath();
+		static MonoString* internal_GetEngineAssemblyName();
+		static MonoString* internal_GetEditorAssemblyName();
+		static MonoString* internal_GetScriptGameAssemblyName();
+		static MonoString* internal_GetScriptEditorAssemblyName();
+		static MonoObject* internal_SaveScene(MonoString* path);
+		static bool internal_IsValidProject(MonoString* path);
+		static void internal_SaveProject();
+		static void internal_LoadProject(MonoString* path);
+		static void internal_UnloadProject();
+		static void internal_CreateProject(MonoString* path);
+		static void internal_ReloadAssemblies();
+		static void internal_OpenExternally(MonoString* path);
+		static void internal_RunUnitTests();
+		static void internal_Quit();
+		static void internal_ToggleToolbarItem(MonoString* name, bool on);
+		static bool internal_GetIsPlaying();
+		static void internal_SetIsPlaying(bool value);
+		static bool internal_GetIsPaused();
+		static void internal_SetIsPaused(bool value);
+		static void internal_FrameStep();
+		static void internal_SetMainRenderTarget(ScriptRenderTarget* renderTarget);
+		static bool internal_HasFocus();
+
+		typedef void(__stdcall *OnProjectLoadedThunkDef)(MonoException**);
+		typedef void(__stdcall *OnStatusBarClickedThunkDef) (MonoException**);
+
+		static OnProjectLoadedThunkDef onProjectLoadedThunk;
+		static OnStatusBarClickedThunkDef onStatusBarClickedThunk;
+	};
+
+	/** @} */
 }

+ 40 - 36
Source/SBansheeEditor/Include/BsScriptEditorBuiltin.h

@@ -1,37 +1,41 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsBuiltinEditorResources.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for BuiltinEditorResources.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorBuiltin : public ScriptObject <ScriptEditorBuiltin>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorBuiltin")
-
-	private:
-		ScriptEditorBuiltin(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_getLibraryItemIcon(ProjectIcon icon, int size);
-		static MonoObject* internal_getXBtnIcon();
-
-		static MonoString* internal_GetEmptyShaderCode();
-		static MonoString* internal_GetEmptyCSScriptCode();
-
-		static MonoObject* internal_GetToolbarIcon(ToolbarIcon icon);
-		static MonoObject* internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
-		static MonoObject* internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
-		static MonoObject* internal_GetSceneWindowIcon(SceneWindowIcon icon);
-		static MonoObject* internal_GetLogIcon(LogMessageIcon icon, int size, bool dark);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsBuiltinEditorResources.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for BuiltinEditorResources. */
+	class BS_SCR_BED_EXPORT ScriptEditorBuiltin : public ScriptObject <ScriptEditorBuiltin>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorBuiltin")
+
+	private:
+		ScriptEditorBuiltin(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoObject* internal_getLibraryItemIcon(ProjectIcon icon, int size);
+		static MonoObject* internal_getXBtnIcon();
+
+		static MonoString* internal_GetEmptyShaderCode();
+		static MonoString* internal_GetEmptyCSScriptCode();
+
+		static MonoObject* internal_GetToolbarIcon(ToolbarIcon icon);
+		static MonoObject* internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
+		static MonoObject* internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
+		static MonoObject* internal_GetSceneWindowIcon(SceneWindowIcon icon);
+		static MonoObject* internal_GetLogIcon(LogMessageIcon icon, int size, bool dark);
+	};
+
+	/** @} */
 }

+ 76 - 90
Source/SBansheeEditor/Include/BsScriptEditorInput.h

@@ -1,91 +1,77 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsInputFwd.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for Editor.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorInput : public ScriptObject<ScriptEditorInput>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorInput")
-
-		/**
-		 * @brief	Registers internal callbacks. Must be called on scripting system load.
-		 */
-		static void startUp();
-
-		/**
-		 * @brief	Unregisters internal callbacks. Must be called on scripting system shutdown.
-		 */
-		static void shutDown();
-	private:
-		ScriptEditorInput(MonoObject* instance);
-
-		/**
-		 * @brief	Triggered when the specified button is pressed.
-		 */
-		static void onButtonDown(const ButtonEvent& ev);
-
-		/**
-		 * @brief	Triggered when the specified button is released.
-		 */
-		static void onButtonUp(const ButtonEvent& ev);
-
-		/**
-		 * @brief	Triggered when the specified character is entered.
-		 */
-		static void onCharInput(const TextInputEvent& ev);
-
-		/**
-		 * @brief	Triggered when the pointer is moved.
-		 */
-		static void onPointerMoved(const PointerEvent& ev);
-
-		/**
-		 * @brief	Triggered when a pointer button is pressed.
-		 */
-		static void onPointerPressed(const PointerEvent& ev);
-
-		/**
-		 * @brief	Triggered when a pointer button is released.
-		 */
-		static void onPointerReleased(const PointerEvent& ev);
-
-		/**
-		 * @brief	Triggered when a pointer button is double-clicked.
-		 */
-		static void onPointerDoubleClick(const PointerEvent& ev);
-
-		static HEvent OnButtonPressedConn;
-		static HEvent OnButtonReleasedConn;
-		static HEvent OnCharInputConn;
-		static HEvent OnPointerPressedConn;
-		static HEvent OnPointerReleasedConn;
-		static HEvent OnPointerMovedConn;
-		static HEvent OnPointerDoubleClickConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-
-		typedef void(__stdcall *OnButtonEventThunkDef) (ButtonCode, UINT32, MonoException**);
-		typedef void(__stdcall *OnCharInputEventThunkDef) (UINT32, MonoException**);
-		typedef void(__stdcall *OnPointerEventThunkDef) (MonoObject*, MonoObject*, PointerEventButton,
-			bool, bool, bool, float, MonoException**);
-
-		static OnButtonEventThunkDef OnButtonPressedThunk;
-		static OnButtonEventThunkDef OnButtonReleasedThunk;
-		static OnCharInputEventThunkDef OnCharInputThunk;
-		static OnPointerEventThunkDef OnPointerPressedThunk;
-		static OnPointerEventThunkDef OnPointerReleasedThunk;
-		static OnPointerEventThunkDef OnPointerMovedThunk;
-		static OnPointerEventThunkDef OnPointerDoubleClickThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsInputFwd.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for Editor. */
+	class BS_SCR_BED_EXPORT ScriptEditorInput : public ScriptObject<ScriptEditorInput>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorInput")
+
+		/**	Registers internal callbacks. Must be called on scripting system load. */
+		static void startUp();
+
+		/**	Unregisters internal callbacks. Must be called on scripting system shutdown. */
+		static void shutDown();
+	private:
+		ScriptEditorInput(MonoObject* instance);
+
+		/**	Triggered when the specified button is pressed. */
+		static void onButtonDown(const ButtonEvent& ev);
+
+		/**	Triggered when the specified button is released. */
+		static void onButtonUp(const ButtonEvent& ev);
+
+		/**	Triggered when the specified character is entered. */
+		static void onCharInput(const TextInputEvent& ev);
+
+		/**	Triggered when the pointer is moved. */
+		static void onPointerMoved(const PointerEvent& ev);
+
+		/**	Triggered when a pointer button is pressed. */
+		static void onPointerPressed(const PointerEvent& ev);
+
+		/**	Triggered when a pointer button is released. */
+		static void onPointerReleased(const PointerEvent& ev);
+
+		/**	Triggered when a pointer button is double-clicked. */
+		static void onPointerDoubleClick(const PointerEvent& ev);
+
+		static HEvent OnButtonPressedConn;
+		static HEvent OnButtonReleasedConn;
+		static HEvent OnCharInputConn;
+		static HEvent OnPointerPressedConn;
+		static HEvent OnPointerReleasedConn;
+		static HEvent OnPointerMovedConn;
+		static HEvent OnPointerDoubleClickConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+
+		typedef void(__stdcall *OnButtonEventThunkDef) (ButtonCode, UINT32, MonoException**);
+		typedef void(__stdcall *OnCharInputEventThunkDef) (UINT32, MonoException**);
+		typedef void(__stdcall *OnPointerEventThunkDef) (MonoObject*, MonoObject*, PointerEventButton,
+			bool, bool, bool, float, MonoException**);
+
+		static OnButtonEventThunkDef OnButtonPressedThunk;
+		static OnButtonEventThunkDef OnButtonReleasedThunk;
+		static OnCharInputEventThunkDef OnCharInputThunk;
+		static OnPointerEventThunkDef OnPointerPressedThunk;
+		static OnPointerEventThunkDef OnPointerReleasedThunk;
+		static OnPointerEventThunkDef OnPointerMovedThunk;
+		static OnPointerEventThunkDef OnPointerDoubleClickThunk;
+	};
+
+	/** @} */
 }

+ 46 - 31
Source/SBansheeEditor/Include/BsScriptEditorPrerequisites.h

@@ -1,32 +1,47 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsEditorPrerequisites.h"
-
-#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
-#	ifdef BS_SCR_BED_EXPORTS
-#		define BS_SCR_BED_EXPORT __declspec(dllexport)
-#	else
-#       if defined( __MINGW32__ )
-#           define BS_SCR_BED_EXPORT
-#       else
-#    		define BS_SCR_BED_EXPORT __declspec(dllimport)
-#       endif
-#	endif
-#elif defined ( BS_GCC_VISIBILITY )
-#    define BS_SCR_BED_EXPORT  __attribute__ ((visibility("default")))
-#else
-#    define BS_SCR_BED_EXPORT
-#endif
-
-namespace BansheeEngine
-{
-	class ScriptEditorWindow;
-	class GUIGameObjectField;
-	class GUIResourceField;
-	class GUITextureField;
-	class ScriptHandleSliderBase;
-	class ScriptPlatformInfo;
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsEditorPrerequisites.h"
+
+#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
+#	ifdef BS_SCR_BED_EXPORTS
+#		define BS_SCR_BED_EXPORT __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define BS_SCR_BED_EXPORT
+#       else
+#    		define BS_SCR_BED_EXPORT __declspec(dllimport)
+#       endif
+#	endif
+#elif defined ( BS_GCC_VISIBILITY )
+#    define BS_SCR_BED_EXPORT  __attribute__ ((visibility("default")))
+#else
+#    define BS_SCR_BED_EXPORT
+#endif
+
+/** @addtogroup Plugins
+
+/** @defgroup SBansheeEditor SBansheeEditor
+ *	Contains script interop objects and other scripting functionality for BansheeEditor.
+ *  @{
+ */
+
+/** @defgroup ScriptInteropEditor Script interop objects
+ *	Script interop objects for communicating between native code and MBansheeEditor managed assembly.
+ *  @{
+ */
+
+/** @} */
+/** @} */
+
+namespace BansheeEngine
+{
+	class ScriptEditorWindow;
+	class GUIGameObjectField;
+	class GUIResourceField;
+	class GUITextureField;
+	class ScriptHandleSliderBase;
+	class ScriptPlatformInfo;
 }

+ 72 - 68
Source/SBansheeEditor/Include/BsScriptEditorSettings.h

@@ -1,69 +1,73 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for EditorSettings stored in EditorApplication.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorSettings : public ScriptObject < ScriptEditorSettings >
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorSettings")
-
-	private:
-		ScriptEditorSettings(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static bool internal_GetMoveHandleSnapActive();
-		static void internal_SetMoveHandleSnapActive(bool value);
-		static bool internal_GetRotateHandleSnapActive();
-		static void internal_SetRotateHandleSnapActive(bool value);
-		static float internal_GetMoveHandleSnapAmount();
-		static void internal_SetMoveHandleSnapAmount(float value);
-		static float internal_GetRotateHandleSnapAmount();
-		static void internal_SetRotateHandleSnapAmount(float value);
-		static float internal_GetDefaultHandleSize();
-		static void internal_SetDefaultHandleSize(float value);
-		static UINT32 internal_GetActiveSceneTool();
-		static void internal_SetActiveSceneTool(UINT32 value);
-		static UINT32 internal_GetActiveCoordinateMode();
-		static void internal_SetActiveCoordinateMode(UINT32 value);
-		static UINT32 internal_GetActivePivotMode();
-		static void internal_SetActivePivotMode(UINT32 value);
-		static UINT32 internal_GetFPSLimit();
-		static void internal_SetFPSLimit(UINT32 value);
-		static float internal_GetMouseSensitivity();
-		static void internal_SetMouseSensitivity(float value);
-
-		static MonoString* internal_GetLastOpenProject();
-		static void internal_SetLastOpenProject(MonoString* value);
-		static bool internal_GetAutoLoadLastProject();
-		static void internal_SetAutoLoadLastProject(bool value);
-		static void internal_GetRecentProjects(MonoArray** paths, MonoArray** timeStamps);
-		static void internal_SetRecentProjects(MonoArray* paths, MonoArray* timeStamps);
-
-		static void internal_SetFloat(MonoString* name, float value);
-		static void internal_SetInt(MonoString* name, int value);
-		static void internal_SetBool(MonoString* name, bool value);
-		static void internal_SetString(MonoString* name, MonoString* value);
-
-		static float internal_GetFloat(MonoString* name, float defaultValue);
-		static int internal_GetInt(MonoString* name, int defaultValue);
-		static bool internal_GetBool(MonoString* name, bool defaultValue);
-		static MonoString* internal_GetString(MonoString* name, MonoString* defaultValue);
-
-		static bool internal_HasKey(MonoString* name);
-		static void internal_DeleteKey(MonoString* name);
-		static void internal_DeleteAllKeys();
-
-		static UINT32 internal_GetHash();
-		static void internal_Save();
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for EditorSettings stored in EditorApplication. */
+	class BS_SCR_BED_EXPORT ScriptEditorSettings : public ScriptObject < ScriptEditorSettings >
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorSettings")
+
+	private:
+		ScriptEditorSettings(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static bool internal_GetMoveHandleSnapActive();
+		static void internal_SetMoveHandleSnapActive(bool value);
+		static bool internal_GetRotateHandleSnapActive();
+		static void internal_SetRotateHandleSnapActive(bool value);
+		static float internal_GetMoveHandleSnapAmount();
+		static void internal_SetMoveHandleSnapAmount(float value);
+		static float internal_GetRotateHandleSnapAmount();
+		static void internal_SetRotateHandleSnapAmount(float value);
+		static float internal_GetDefaultHandleSize();
+		static void internal_SetDefaultHandleSize(float value);
+		static UINT32 internal_GetActiveSceneTool();
+		static void internal_SetActiveSceneTool(UINT32 value);
+		static UINT32 internal_GetActiveCoordinateMode();
+		static void internal_SetActiveCoordinateMode(UINT32 value);
+		static UINT32 internal_GetActivePivotMode();
+		static void internal_SetActivePivotMode(UINT32 value);
+		static UINT32 internal_GetFPSLimit();
+		static void internal_SetFPSLimit(UINT32 value);
+		static float internal_GetMouseSensitivity();
+		static void internal_SetMouseSensitivity(float value);
+
+		static MonoString* internal_GetLastOpenProject();
+		static void internal_SetLastOpenProject(MonoString* value);
+		static bool internal_GetAutoLoadLastProject();
+		static void internal_SetAutoLoadLastProject(bool value);
+		static void internal_GetRecentProjects(MonoArray** paths, MonoArray** timeStamps);
+		static void internal_SetRecentProjects(MonoArray* paths, MonoArray* timeStamps);
+
+		static void internal_SetFloat(MonoString* name, float value);
+		static void internal_SetInt(MonoString* name, int value);
+		static void internal_SetBool(MonoString* name, bool value);
+		static void internal_SetString(MonoString* name, MonoString* value);
+
+		static float internal_GetFloat(MonoString* name, float defaultValue);
+		static int internal_GetInt(MonoString* name, int defaultValue);
+		static bool internal_GetBool(MonoString* name, bool defaultValue);
+		static MonoString* internal_GetString(MonoString* name, MonoString* defaultValue);
+
+		static bool internal_HasKey(MonoString* name);
+		static void internal_DeleteKey(MonoString* name);
+		static void internal_DeleteAllKeys();
+
+		static UINT32 internal_GetHash();
+		static void internal_Save();
+	};
+
+	/** @} */
 }

+ 25 - 23
Source/SBansheeEditor/Include/BsScriptEditorTestSuite.h

@@ -1,24 +1,26 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsTestSuite.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Performs editor managed unit tests.
-	 */
-	class ScriptEditorTestSuite : public TestSuite
-	{
-	public:
-		ScriptEditorTestSuite();
-
-	private:
-		/**
-		 * @brief	Triggers execution of managed unit tests.
-		 */
-		void runManagedTests();
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsTestSuite.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Performs editor managed unit tests. */
+	class ScriptEditorTestSuite : public TestSuite
+	{
+	public:
+		ScriptEditorTestSuite();
+
+	private:
+		/**	Triggers execution of managed unit tests. */
+		void runManagedTests();
+	};
+
+	/** @} */
 }

+ 31 - 27
Source/SBansheeEditor/Include/BsScriptEditorUtility.h

@@ -1,28 +1,32 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for EditorUtility.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorUtility : public ScriptObject <ScriptEditorUtility>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorUtility")
-
-	private:
-		ScriptEditorUtility(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CalculateBounds(MonoObject* so, AABox* bounds);
-		static void internal_CalculateBoundsArray(MonoArray* objects, AABox* bounds);
-		static MonoArray* internal_FindDependencies(MonoObject* resource, bool recursive);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for EditorUtility. */
+	class BS_SCR_BED_EXPORT ScriptEditorUtility : public ScriptObject <ScriptEditorUtility>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorUtility")
+
+	private:
+		ScriptEditorUtility(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CalculateBounds(MonoObject* so, AABox* bounds);
+		static void internal_CalculateBoundsArray(MonoArray* objects, AABox* bounds);
+		static MonoArray* internal_FindDependencies(MonoObject* resource, bool recursive);
+	};
+
+	/** @} */
 }

+ 68 - 68
Source/SBansheeEditor/Include/BsScriptEditorVirtualInput.h

@@ -1,69 +1,69 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsInputConfiguration.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for EditorVirtualInput.
-	 */
-	class BS_SCR_BED_EXPORT ScriptEditorVirtualInput : public ScriptObject<ScriptEditorVirtualInput>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEngine", "EditorVirtualInput")
-
-		/**
-		 * @brief	Must be called on library load. Hooks up necessary callbacks.
-		 */
-		static void startUp();
-
-		/**
-		 * @brief	Must be called before library shutdown. Releases previously hooked callbacks.
-		 */
-		static void shutDown();
-	private:
-		/**
-		 * @brief	Triggered whenever a virtual button is pressed.
-		 *
-		 * @param	btn			Virtual button that was pressed.
-		 * @param	deviceIdx	Index of the device the button was pressed on.
-		 */
-		static void onButtonDown(const VirtualButton& btn, UINT32 deviceIdx);
-
-		/**
-		 * @brief	Triggered whenever a virtual button is released.
-		 *
-		 * @param	btn			Virtual button that was released.
-		 * @param	deviceIdx	Index of the device the button was released on.
-		 */
-		static void onButtonUp(const VirtualButton& btn, UINT32 deviceIdx);
-
-		/**
-		 * @brief	Triggered every frame while a virtual button is held down.
-		 *
-		 * @param	btn			Virtual button that is being held.
-		 * @param	deviceIdx	Index of the device the button is held.
-		 */
-		static void onButtonHeld(const VirtualButton& btn, UINT32 deviceIdx);
-
-		static HEvent OnButtonPressedConn;
-		static HEvent OnButtonReleasedConn;
-		static HEvent OnButtonHeldConn;
-
-		ScriptEditorVirtualInput(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-
-		typedef void(__stdcall *OnButtonEventThunkDef) (MonoObject*, UINT32, MonoException**);
-
-		static OnButtonEventThunkDef OnButtonUpThunk;
-		static OnButtonEventThunkDef OnButtonDownThunk;
-		static OnButtonEventThunkDef OnButtonHeldThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsInputConfiguration.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for EditorVirtualInput. */
+	class BS_SCR_BED_EXPORT ScriptEditorVirtualInput : public ScriptObject<ScriptEditorVirtualInput>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEngine", "EditorVirtualInput")
+
+		/**	Must be called on library load. Hooks up necessary callbacks. */
+		static void startUp();
+
+		/**	Must be called before library shutdown. Releases previously hooked callbacks. */
+		static void shutDown();
+	private:
+		/**
+		 * Triggered whenever a virtual button is pressed.
+		 *
+		 * @param[in]	btn			Virtual button that was pressed.
+		 * @param[in]	deviceIdx	Index of the device the button was pressed on.
+		 */
+		static void onButtonDown(const VirtualButton& btn, UINT32 deviceIdx);
+
+		/**
+		 * Triggered whenever a virtual button is released.
+		 *
+		 * @param[in]	btn			Virtual button that was released.
+		 * @param[in]	deviceIdx	Index of the device the button was released on.
+		 */
+		static void onButtonUp(const VirtualButton& btn, UINT32 deviceIdx);
+
+		/**
+		 * Triggered every frame while a virtual button is held down.
+		 *
+		 * @param[in]	btn			Virtual button that is being held.
+		 * @param[in]	deviceIdx	Index of the device the button is held.
+		 */
+		static void onButtonHeld(const VirtualButton& btn, UINT32 deviceIdx);
+
+		static HEvent OnButtonPressedConn;
+		static HEvent OnButtonReleasedConn;
+		static HEvent OnButtonHeldConn;
+
+		ScriptEditorVirtualInput(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+
+		typedef void(__stdcall *OnButtonEventThunkDef) (MonoObject*, UINT32, MonoException**);
+
+		static OnButtonEventThunkDef OnButtonUpThunk;
+		static OnButtonEventThunkDef OnButtonDownThunk;
+		static OnButtonEventThunkDef OnButtonHeldThunk;
+	};
+
+	/** @} */
 }

+ 48 - 77
Source/SBansheeEditor/Include/BsScriptEditorWindow.h

@@ -9,16 +9,16 @@
 
 namespace BansheeEngine
 {
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
 	class ScriptEditorWidget;
 
-	/**
-	 * @brief	Interop class between C++ & CLR for ScriptEditorWidget.
-	 */
+	/**	Interop class between C++ & CLR for ScriptEditorWidget. */
 	class BS_SCR_BED_EXPORT ScriptEditorWindow : public ScriptObject<ScriptEditorWindow, PersistentScriptObjectBase>
 	{
-		/**
-		 * @brief	Contains data about the managed handle to an editor window.
-		 */
+		/**	Contains data about the managed handle to an editor window. */
 		struct EditorWindowHandle
 		{
 			uint32_t gcHandle;
@@ -29,25 +29,20 @@ namespace BansheeEngine
 
 		~ScriptEditorWindow();
 
-		/**
-		 * @brief	Returns the internal wrapped editor widget.
-		 */
+		/**	Returns the internal wrapped editor widget. */
 		EditorWidgetBase* getEditorWidget() const;
 
-		/**
-		 * @brief	Checks has the native widget been destroyed.
-		 */
+		/**	Checks has the native widget been destroyed. */
 		bool isDestroyed() const { return mIsDestroyed; }
 
 		/**
-		 * @brief	Finds all editor window implementations in managed assemblies and registers
-		 *			them with the editor widget system.
+		 * Finds all editor window implementations in managed assemblies and registers them with the editor widget system.
 		 */
 		static void registerManagedEditorWindows();
 
 		/**
-		 * @brief	Removes all editor widgets registered previously with ::registerManagedEditorWindows.
-		 *			Useful during assembly refresh when editor window implementations might be added/removed.
+		 * Removes all editor widgets registered previously with registerManagedEditorWindows(). Useful during assembly
+		 * refresh when editor window implementations might be added/removed.
 		 */
 		static void clearRegisteredEditorWindow();
 
@@ -56,39 +51,25 @@ namespace BansheeEngine
 
 		ScriptEditorWindow(ScriptEditorWidget* editorWidget);
 
-		/**
-		 * @brief	Triggered when the native editor widget is resized.
-		 */
+		/**	Triggered when the native editor widget is resized. */
 		void onWidgetResized(UINT32 width, UINT32 height);
 
-		/**
-		 * @brief	Triggered when the native editor widget gains or loses focus.
-		 */
+		/**	Triggered when the native editor widget gains or loses focus. */
 		void onFocusChanged(bool inFocus);
 
-		/**
-		 * @brief	Triggered when assembly refresh has started.
-		 */
+		/**	Triggered when assembly refresh has started. */
 		void onAssemblyRefreshStarted();
 
-		/**
-		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
-		 */
+		/** @copydoc ScriptObjectBase::_onManagedInstanceDeleted */
 		void _onManagedInstanceDeleted() override;
 
-		/**
-		 * @copydoc	ScriptObjectBase::beginRefresh
-		 */
+		/** @copydoc ScriptObjectBase::beginRefresh */
 		ScriptObjectBackup beginRefresh() override;
 
-		/**
-		 * @copydoc	ScriptObjectBase::endRefresh
-		 */
+		/** @copydoc ScriptObjectBase::endRefresh */
 		void endRefresh(const ScriptObjectBackup& backupData) override;
 
-		/**
-		 * @copydoc	ScriptObjectBase::_createManagedInstance
-		 */
+		/** @copydoc ScriptObjectBase::_createManagedInstance */
 		MonoObject* _createManagedInstance(bool construct) override;
 
 		String mName;
@@ -106,21 +87,18 @@ namespace BansheeEngine
 		// Global editor window management methods
 
 		/**
-		 * @brief	Registers a newly created editor window interop object and adds it to
-		 *			a list of currently active editor windows.
+		 * Registers a newly created editor window interop object and adds it to a list of currently active editor windows.
 		 */
 		static void registerScriptEditorWindow(ScriptEditorWindow* editorWindow);
 
 		/**
-		 * @brief	Removes a window from the active editor window list.
+		 * Removes a window from the active editor window list.
 		 *
-		 * @param	windowTypeName	Name of the window type. Provided by EditorWidget::getName.
+		 * @param[in]	windowTypeName	Name of the window type. Provided by EditorWidget::getName.
 		 */
 		static void unregisterScriptEditorWindow(const String& windowTypeName);
 
-		/**
-		* @brief	Callback that is triggered when user requests a widget to be opened.
-		*/
+		/**	Callback that is triggered when user requests a widget to be opened. */
 		static EditorWidgetBase* openEditorWidgetCallback(String ns, String type, UINT32 width, UINT32 height, 
 			EditorWidgetContainer& parentContainer);
 
@@ -144,74 +122,65 @@ namespace BansheeEngine
 		static void internal_getBounds(ScriptEditorWindow* thisPtr, Rect2I* bounds);
 	};
 
+	/** @} */
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
 	/**
-	 * @brief	Editor widget implementation that handles managed editor window implementations.
-	 *			Each implementation is wrapped in this object and then managed by its parent interop
-	 *			object of ScriptEditorWindow type.
+	 * Editor widget implementation that handles managed editor window implementations. Each implementation is wrapped in
+	 * this object and then managed by its parent interop object of ScriptEditorWindow type.
 	 */
 	class BS_SCR_BED_EXPORT ScriptEditorWidget : public EditorWidgetBase
 	{
 	public:
 		/**
-		 * @brief	Constructs a new managed widget.
+		 * Constructs a new managed widget.
 		 *
-		 * @param	ns				Namespace of the widget type.
-		 * @param	type			Name of the widget type.
-		 * @param	defaultWidth	Default width of the widget when initially created.
-		 * @param	defaultHeight	Default height of the widget when initially created.
-		 * @param	parentContainer	Container to initially dock the widget in.
+		 * @param[in]	ns				Namespace of the widget type.
+		 * @param[in]	type			Name of the widget type.
+		 * @param[in]	defaultWidth	Default width of the widget when initially created.
+		 * @param[in]	defaultHeight	Default height of the widget when initially created.
+		 * @param[in]	parentContainer	Container to initially dock the widget in.
 		 */
 		ScriptEditorWidget(const String& ns, const String& type, UINT32 defaultWidth, 
 			UINT32 defaultHeight, EditorWidgetContainer& parentContainer);
 		~ScriptEditorWidget();
 
 		/**
-		 * @brief	Attempts to create a managed instance for the editor window described by the
-		 *			type provided upon construction.
+		 * Attempts to create a managed instance for the editor window described by the type provided upon construction.
 		 *
 		 * @return	True if the managed instance was created.
 		 */
 		bool createManagedInstance();
 
-		/**
-		 * @brief	Checks has the OnInitialize method been called yet.
-		 */
+		/** Checks has the OnInitialize method been called yet. */
 		bool isInitialized() const { return mIsInitialized; }
 
-		/**
-		 * @copydoc	EditorWidgetBase::update 
-		 */
+		/** @copydoc EditorWidgetBase::update  */
 		void update() override;
 
 		/**
-		 * @brief	Loads all required mono methods, fields and types required
-		 *			for operation of this object. Must be called after construction
-		 *			and after assembly refresh.
+		 * Loads all required mono methods, fields and types required for operation of this object. Must be called after
+		 * construction and after assembly refresh.
 		 *
-		 * @param	windowClass	Mono class to load the types from.
+		 * @param[in]	windowClass		Mono class to load the types from.
 		 */
 		void reloadMonoTypes(MonoClass* windowClass);
 
-		/**
-		 * @brief	Triggers OnInitialize callbacks on the managed instance.
-		 */
+		/**	Triggers OnInitialize callbacks on the managed instance. */
 		void triggerOnInitialize();
 
-		/**
-		 * @brief	Triggers OnDestroy callbacks on the managed instance.
-		 */
+		/**	Triggers OnDestroy callbacks on the managed instance. */
 		void triggerOnDestroy();
 
 		/**
-		 * @brief	Sets the parent interop object that handles part of the communication
-		 *			between this object and the managed instance.
+		 * Sets the parent interop object that handles part of the communication between this object and the managed
+		 * instance.
 		 */
 		void setScriptOwner(ScriptEditorWindow* owner) { mScriptOwner = owner; }
 
-		/**
-		 * @brief	Returns the managed instance for the editor window
-		 *			represented by this object.
-		 */
+		/**	Returns the managed instance for the editor window represented by this object. */
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
 
 	private:
@@ -232,4 +201,6 @@ namespace BansheeEngine
 		ScriptGUILayout* mContentsPanel;
 		bool mIsInitialized;
 	};
+
+	/** @} */
 }

+ 87 - 99
Source/SBansheeEditor/Include/BsScriptFolderMonitor.h

@@ -1,100 +1,88 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsFolderMonitor.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for FolderMonitor.
-	 */
-	class BS_SCR_BED_EXPORT ScriptFolderMonitor : public ScriptObject <ScriptFolderMonitor>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FolderMonitor")
-
-	private:
-		friend class ScriptFolderMonitorManager;
-
-		ScriptFolderMonitor(MonoObject* instance, FolderMonitor* monitor);
-		~ScriptFolderMonitor();
-
-		/**
-		 * @brief	Updates the native folder monitor. Must be called once per frame.
-		 */
-		void update();
-
-		/**
-		 * @brief	Destroys the native folder monitor.
-		 */
-		void destroy();
-
-		/**
-		 * @brief	Triggered when the native folder monitor detects a file has been modified.
-		 */
-		void onMonitorFileModified(const Path& path);
-
-		/**
-		 * @brief	Triggered when the native folder monitor detects a file has been added.
-		 */
-		void onMonitorFileAdded(const Path& path);
-
-		/**
-		 * @brief	Triggered when the native folder monitor detects a file has been removed.
-		 */
-		void onMonitorFileRemoved(const Path& path);
-
-		/**
-		 * @brief	Triggered when the native folder monitor detects a file has been renamed.
-		 */
-		void onMonitorFileRenamed(const Path& from, const Path& to);
-
-		FolderMonitor* mMonitor;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, MonoString* folder);
-		static void internal_Destroy(ScriptFolderMonitor* thisPtr);
-
-		typedef void(__stdcall *OnModifiedThunkDef) (MonoObject*, MonoString*, MonoException**);
-		typedef void(__stdcall *OnRenamedThunkDef) (MonoObject*, MonoString*, MonoString*, MonoException**);
-
-		static OnModifiedThunkDef OnModifiedThunk;
-		static OnModifiedThunkDef OnAddedThunk;
-		static OnModifiedThunkDef OnRemovedThunk;
-		static OnRenamedThunkDef OnRenamedThunk;
-	};
-
-	/**
-	 * @brief	Manages all active managed folder monitor objects.
-	 */
-	class BS_SCR_BED_EXPORT ScriptFolderMonitorManager : public Module<ScriptFolderMonitorManager>
-	{
-	public:
-		/**
-		 * @brief	Triggers updates on all active folder monitor objects. Should be called
-		 *			once per frame.
-		 */
-		void update();
-
-	private:
-		friend class ScriptFolderMonitor;
-
-		/**
-		 * @brief	Registers a new managed folder monitor.
-		 */
-		void _registerMonitor(ScriptFolderMonitor* monitor);
-
-		/**
-		 * @brief	Unregisters a destroyed managed folder monitor.
-		 */
-		void _unregisterMonitor(ScriptFolderMonitor* monitor);
-
-		UnorderedSet<ScriptFolderMonitor*> mMonitors;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsFolderMonitor.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for FolderMonitor. */
+	class BS_SCR_BED_EXPORT ScriptFolderMonitor : public ScriptObject <ScriptFolderMonitor>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FolderMonitor")
+
+	private:
+		friend class ScriptFolderMonitorManager;
+
+		ScriptFolderMonitor(MonoObject* instance, FolderMonitor* monitor);
+		~ScriptFolderMonitor();
+
+		/**	Updates the native folder monitor. Must be called once per frame. */
+		void update();
+
+		/**	Destroys the native folder monitor. */
+		void destroy();
+
+		/**	Triggered when the native folder monitor detects a file has been modified. */
+		void onMonitorFileModified(const Path& path);
+
+		/**	Triggered when the native folder monitor detects a file has been added. */
+		void onMonitorFileAdded(const Path& path);
+
+		/**	Triggered when the native folder monitor detects a file has been removed. */
+		void onMonitorFileRemoved(const Path& path);
+
+		/**	Triggered when the native folder monitor detects a file has been renamed. */
+		void onMonitorFileRenamed(const Path& from, const Path& to);
+
+		FolderMonitor* mMonitor;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, MonoString* folder);
+		static void internal_Destroy(ScriptFolderMonitor* thisPtr);
+
+		typedef void(__stdcall *OnModifiedThunkDef) (MonoObject*, MonoString*, MonoException**);
+		typedef void(__stdcall *OnRenamedThunkDef) (MonoObject*, MonoString*, MonoString*, MonoException**);
+
+		static OnModifiedThunkDef OnModifiedThunk;
+		static OnModifiedThunkDef OnAddedThunk;
+		static OnModifiedThunkDef OnRemovedThunk;
+		static OnRenamedThunkDef OnRenamedThunk;
+	};
+
+	/** @} */
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Manages all active managed folder monitor objects. */
+	class BS_SCR_BED_EXPORT ScriptFolderMonitorManager : public Module<ScriptFolderMonitorManager>
+	{
+	public:
+		/**	Triggers updates on all active folder monitor objects. Should be called once per frame. */
+		void update();
+
+	private:
+		friend class ScriptFolderMonitor;
+
+		/**	Registers a new managed folder monitor. */
+		void _registerMonitor(ScriptFolderMonitor* monitor);
+
+		/**	Unregisters a destroyed managed folder monitor. */
+		void _unregisterMonitor(ScriptFolderMonitor* monitor);
+
+		UnorderedSet<ScriptFolderMonitor*> mMonitors;
+	};
+
+	/** @} */
 }

+ 46 - 42
Source/SBansheeEditor/Include/BsScriptGUIColorField.h

@@ -1,43 +1,47 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-#include "BsColor.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIColorField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
-
-	private:
-		ScriptGUIColorField(MonoObject* instance, GUIColorField* colorField);
-
-		/**
-		 * @brief	Triggered when the user clicks on the native color field.
-		 *
-		 * @param	instance	Managed GUIColorField instance.
-		 */
-		static void onClicked(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIColorField* nativeInstance, Color* output);
-		static void internal_setValue(ScriptGUIColorField* nativeInstance, Color* value);
-		static void internal_setTint(ScriptGUIColorField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnClickedThunkDef) (MonoObject*, MonoException**);
-
-		static OnClickedThunkDef onClickedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+#include "BsColor.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIColorField. */
+	class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
+
+	private:
+		ScriptGUIColorField(MonoObject* instance, GUIColorField* colorField);
+
+		/**
+		 * Triggered when the user clicks on the native color field.
+		 *
+		 * @param[in]	instance	Managed GUIColorField instance.
+		 */
+		static void onClicked(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIColorField* nativeInstance, Color* output);
+		static void internal_setValue(ScriptGUIColorField* nativeInstance, Color* value);
+		static void internal_setTint(ScriptGUIColorField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnClickedThunkDef) (MonoObject*, MonoException**);
+
+		static OnClickedThunkDef onClickedThunk;
+	};
+
+	/** @} */
 }

+ 56 - 50
Source/SBansheeEditor/Include/BsScriptGUIEnumField.h

@@ -1,51 +1,57 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIListBoxField, with some specific functionality
-	 *			meant for displaying managed enumeration values.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIEnumField : public TScriptGUIElement<ScriptGUIEnumField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIEnumField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native list box selection changes.
-		 *
-		 * @param	instance	Managed GUIEnumField instance.
-		 * @param	newIndex	Index of the selected element.
-		 * @param	enabled		Determines whether the element at the selection index was enabled or disabled.
-		 */
-		static void onSelectionChanged(MonoObject* instance, UINT64 newIndex, bool enabled);
-
-		ScriptGUIEnumField(MonoObject* instance, GUIListBoxField* listBoxField, const Vector<UINT64>& values);
-
-		Vector<UINT64> mValues;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoArray* names, MonoArray* values, bool multiselect,
-			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static UINT64 internal_getValue(ScriptGUIEnumField* nativeInstance);
-		static void internal_setValue(ScriptGUIEnumField* nativeInstance, UINT64 value);
-		static void internal_setTint(ScriptGUIEnumField* nativeInstance, Color* color);
-		static void internal_selectElement(ScriptGUIEnumField* nativeInstance, int idx);
-		static void internal_deselectElement(ScriptGUIEnumField* nativeInstance, int idx);
-		static MonoArray* internal_getElementStates(ScriptGUIEnumField* nativeInstance);
-		static void internal_setElementStates(ScriptGUIEnumField* nativeInstance, MonoArray* states);
-
-		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT64, MonoException**);
-
-		static OnSelectionChangedThunkDef onSelectionChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**
+	 * Interop class between C++ & CLR for GUIListBoxField, with some specific functionality meant for displaying managed
+	 * enumeration values.
+	 */
+	class BS_SCR_BED_EXPORT ScriptGUIEnumField : public TScriptGUIElement<ScriptGUIEnumField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIEnumField")
+
+	private:
+		/**
+		 * Triggered when the value in the native list box selection changes.
+		 *
+		 * @param[in]	instance	Managed GUIEnumField instance.
+		 * @param[in]	newIndex	Index of the selected element.
+		 * @param[in]	enabled		Determines whether the element at the selection index was enabled or disabled.
+		 */
+		static void onSelectionChanged(MonoObject* instance, UINT64 newIndex, bool enabled);
+
+		ScriptGUIEnumField(MonoObject* instance, GUIListBoxField* listBoxField, const Vector<UINT64>& values);
+
+		Vector<UINT64> mValues;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoArray* names, MonoArray* values, bool multiselect,
+			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static UINT64 internal_getValue(ScriptGUIEnumField* nativeInstance);
+		static void internal_setValue(ScriptGUIEnumField* nativeInstance, UINT64 value);
+		static void internal_setTint(ScriptGUIEnumField* nativeInstance, Color* color);
+		static void internal_selectElement(ScriptGUIEnumField* nativeInstance, int idx);
+		static void internal_deselectElement(ScriptGUIEnumField* nativeInstance, int idx);
+		static MonoArray* internal_getElementStates(ScriptGUIEnumField* nativeInstance);
+		static void internal_setElementStates(ScriptGUIEnumField* nativeInstance, MonoArray* states);
+
+		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT64, MonoException**);
+
+		static OnSelectionChangedThunkDef onSelectionChangedThunk;
+	};
+
+	/** @} */
 }

+ 57 - 53
Source/SBansheeEditor/Include/BsScriptGUIFloatField.h

@@ -1,54 +1,58 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIFloatField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
-
-	private:
-		ScriptGUIFloatField(MonoObject* instance, GUIFloatField* floatField);
-
-		/**
-		 * @brief	Triggered when the value in the native float field changes.
-		 *
-		 * @param	instance	Managed GUIFloatField instance.
-		 * @param	newValue	New field value.
-		 */
-		static void onChanged(MonoObject* instance, float newValue);
-
-		/**
-		 * @brief	Triggered when the user confirms input in the native float field.
-		 *
-		 * @param	instance	Managed GUIFloatField instance.
-		 */
-		static void onConfirmed(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
-		static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
-		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
-		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
-		static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
-		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-		static OnConfirmedThunkDef onConfirmedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIFloatField. */
+	class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
+
+	private:
+		ScriptGUIFloatField(MonoObject* instance, GUIFloatField* floatField);
+
+		/**
+		 * Triggered when the value in the native float field changes.
+		 *
+		 * @param[in]	instance	Managed GUIFloatField instance.
+		 * @param[in]	newValue	New field value.
+		 */
+		static void onChanged(MonoObject* instance, float newValue);
+
+		/**
+		 * Triggered when the user confirms input in the native float field.
+		 *
+		 * @param[in]	instance	Managed GUIFloatField instance.
+		 */
+		static void onConfirmed(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
+		static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
+		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
+		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
+		static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
+		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+		static OnConfirmedThunkDef onConfirmedThunk;
+	};
+
+	/** @} */
 }

+ 49 - 49
Source/SBansheeEditor/Include/BsScriptGUIGameObjectField.h

@@ -1,50 +1,50 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIGameObjectField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native game object field changes.
-		 *
-		 * @param	instance	Managed GUIGameObjectField instance.
-		 * @param	newValue	New field value.
-		 */
-		static void onChanged(MonoObject* instance, const HGameObject& newValue);
-
-		/**
-		 * @brief	Retrieves a managed instance of the specified native game object.
-		 *			Will return null if one doesn't exist.
-		 */
-		static MonoObject* nativeToManagedGO(const HGameObject& instance);
-
-		ScriptGUIGameObjectField(MonoObject* instance, GUIGameObjectField* GOField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIGameObjectField* nativeInstance, MonoObject** output);
-		static void internal_setValue(ScriptGUIGameObjectField* nativeInstance, MonoObject* value);
-		static void internal_setTint(ScriptGUIGameObjectField* nativeInstance, Color* color);
-
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIGameObjectField. */
+	class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
+
+	private:
+		/**
+		 * Triggered when the value in the native game object field changes.
+		 *
+		 * @param[in]	instance	Managed GUIGameObjectField instance.
+		 * @param[in]	newValue	New field value.
+		 */
+		static void onChanged(MonoObject* instance, const HGameObject& newValue);
+
+		/** Retrieves a managed instance of the specified native game object. Will return null if one doesn't exist. */
+		static MonoObject* nativeToManagedGO(const HGameObject& instance);
+
+		ScriptGUIGameObjectField(MonoObject* instance, GUIGameObjectField* GOField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, 
+			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIGameObjectField* nativeInstance, MonoObject** output);
+		static void internal_setValue(ScriptGUIGameObjectField* nativeInstance, MonoObject* value);
+		static void internal_setTint(ScriptGUIGameObjectField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+	};
+
+	/** @} */
 }

+ 57 - 53
Source/SBansheeEditor/Include/BsScriptGUIIntField.h

@@ -1,54 +1,58 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIIntField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native int field changes.
-		 *
-		 * @param	instance	Managed GUIIntField instance.
-		 * @param	newValue	New field value.
-		 */
-		static void onChanged(MonoObject* instance, INT32 newValue);
-
-		/**
-		 * @brief	Triggered when the user confirms input in the native int field.
-		 *
-		 * @param	instance	Managed GUIIntField instance.
-		 */
-		static void onConfirmed(MonoObject* instance);
-
-		ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
-		static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
-		static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
-		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
-		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
-
-		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
-		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-		static OnConfirmedThunkDef onConfirmedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIIntField. */
+	class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
+
+	private:
+		/**
+		 * Triggered when the value in the native int field changes.
+		 *
+		 * @param[in]	instance	Managed GUIIntField instance.
+		 * @param[in]	newValue	New field value.
+		 */
+		static void onChanged(MonoObject* instance, INT32 newValue);
+
+		/**
+		 * Triggered when the user confirms input in the native int field.
+		 *
+		 * @param[in]	instance	Managed GUIIntField instance.
+		 */
+		static void onConfirmed(MonoObject* instance);
+
+		ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
+		static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
+		static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
+		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
+		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
+
+		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
+		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+		static OnConfirmedThunkDef onConfirmedThunk;
+	};
+
+	/** @} */
 }

+ 51 - 47
Source/SBansheeEditor/Include/BsScriptGUIListBoxField.h

@@ -1,48 +1,52 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIListBoxField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIListBoxField : public TScriptGUIElement<ScriptGUIListBoxField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIListBoxField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native list box selection changes.
-		 *
-		 * @param	instance	Managed GUIListBoxField instance.
-		 * @param	newIndex	New selection index.
-		 */
-		static void onSelectionChanged(MonoObject* instance, UINT32 newIndex);
-
-		ScriptGUIListBoxField(MonoObject* instance, GUIListBoxField* listBoxField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, 
-			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_setElements(ScriptGUIListBoxField* nativeInstance, MonoArray* elements);
-		static UINT32 internal_getValue(ScriptGUIListBoxField* nativeInstance);
-		static void internal_setValue(ScriptGUIListBoxField* nativeInstance, UINT32 value);
-		static void internal_selectElement(ScriptGUIListBoxField* nativeInstance, int idx);
-		static void internal_deselectElement(ScriptGUIListBoxField* nativeInstance, int idx);
-		static MonoArray* internal_getElementStates(ScriptGUIListBoxField* nativeInstance);
-		static void internal_setElementStates(ScriptGUIListBoxField* nativeInstance, MonoArray* states);
-		static void internal_setTint(ScriptGUIListBoxField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
-
-		static OnSelectionChangedThunkDef onSelectionChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIListBoxField. */
+	class BS_SCR_BED_EXPORT ScriptGUIListBoxField : public TScriptGUIElement<ScriptGUIListBoxField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIListBoxField")
+
+	private:
+		/**
+		 * Triggered when the value in the native list box selection changes.
+		 *
+		 * @param[in]	instance	Managed GUIListBoxField instance.
+		 * @param[in]	newIndex	New selection index.
+		 */
+		static void onSelectionChanged(MonoObject* instance, UINT32 newIndex);
+
+		ScriptGUIListBoxField(MonoObject* instance, GUIListBoxField* listBoxField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, 
+			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_setElements(ScriptGUIListBoxField* nativeInstance, MonoArray* elements);
+		static UINT32 internal_getValue(ScriptGUIListBoxField* nativeInstance);
+		static void internal_setValue(ScriptGUIListBoxField* nativeInstance, UINT32 value);
+		static void internal_selectElement(ScriptGUIListBoxField* nativeInstance, int idx);
+		static void internal_deselectElement(ScriptGUIListBoxField* nativeInstance, int idx);
+		static MonoArray* internal_getElementStates(ScriptGUIListBoxField* nativeInstance);
+		static void internal_setElementStates(ScriptGUIListBoxField* nativeInstance, MonoArray* states);
+		static void internal_setTint(ScriptGUIListBoxField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
+
+		static OnSelectionChangedThunkDef onSelectionChangedThunk;
+	};
+
+	/** @} */
 }

+ 51 - 50
Source/SBansheeEditor/Include/BsScriptGUIResourceField.h

@@ -1,51 +1,52 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIResourceField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIResourceField : public TScriptGUIElement<ScriptGUIResourceField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIResourceField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native resource field changes.
-		 *
-		 * @param	instance	Managed GUIResourceField instance.
-		 * @param	newHandle	Weak handle of the newly selected resource.
-		 */
-		static void onChanged(MonoObject* instance, const WeakResourceHandle<Resource>& newHandle);
-
-		/**
-		 * @brief	Retrieves a managed instance of the specified native resource.
-		 *			Will return null if one doesn't exist.
-		 */
-		static MonoObject* nativeToManagedResource(const HResource& instance);
-
-		ScriptGUIResourceField(MonoObject* instance, GUIResourceField* resourceField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIResourceField* nativeInstance, MonoObject** output);
-		static void internal_setValue(ScriptGUIResourceField* nativeInstance, MonoObject* value);
-		static void internal_getValueRef(ScriptGUIResourceField* nativeInstance, MonoObject** output);
-		static void internal_setValueRef(ScriptGUIResourceField* nativeInstance, MonoObject* value);
-		static void internal_setTint(ScriptGUIResourceField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIResourceField. */
+	class BS_SCR_BED_EXPORT ScriptGUIResourceField : public TScriptGUIElement<ScriptGUIResourceField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIResourceField")
+
+	private:
+		/**
+		 * Triggered when the value in the native resource field changes.
+		 *
+		 * @param[in]	instance	Managed GUIResourceField instance.
+		 * @param[in]	newHandle	Weak handle of the newly selected resource.
+		 */
+		static void onChanged(MonoObject* instance, const WeakResourceHandle<Resource>& newHandle);
+
+		/** Retrieves a managed instance of the specified native resource. Will return null if one doesn't exist. */
+		static MonoObject* nativeToManagedResource(const HResource& instance);
+
+		ScriptGUIResourceField(MonoObject* instance, GUIResourceField* resourceField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, 
+			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIResourceField* nativeInstance, MonoObject** output);
+		static void internal_setValue(ScriptGUIResourceField* nativeInstance, MonoObject* value);
+		static void internal_getValueRef(ScriptGUIResourceField* nativeInstance, MonoObject** output);
+		static void internal_setValueRef(ScriptGUIResourceField* nativeInstance, MonoObject* value);
+		static void internal_setTint(ScriptGUIResourceField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+	};
+
+	/** @} */
 }

+ 6 - 0
Source/SBansheeEditor/Include/BsScriptGUISceneTreeView.h

@@ -7,6 +7,10 @@
 
 namespace BansheeEngine
 {
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
 	/**	Interop class between C++ & CLR for GUISceneTreeView. */
 	class BS_SCR_BED_EXPORT ScriptGUISceneTreeView : public TScriptGUIElement<ScriptGUISceneTreeView>
 	{
@@ -44,4 +48,6 @@ namespace BansheeEngine
 		static OnModifiedThunkDef onModifiedThunk;
 		static OnResourceDroppedThunkDef onResourceDroppedThunk;
 	};
+
+	/** @} */
 }

+ 48 - 44
Source/SBansheeEditor/Include/BsScriptGUISliderField.h

@@ -1,45 +1,49 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUISliderField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUISliderField : public TScriptGUIElement<ScriptGUISliderField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUISliderField")
-
-	private:
-		ScriptGUISliderField(MonoObject* instance, GUISliderField* sliderField);
-
-		/**
-		 * @brief	Triggered when the value in the native slider field changes.
-		 *
-		 * @param	instance	Managed GUISliderField instance.
-		 * @param	newValue	New field value.
-		 */
-		static void onChanged(MonoObject* instance, float newValue);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, float min, float max, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static float internal_getValue(ScriptGUISliderField* nativeInstance);
-		static void internal_setValue(ScriptGUISliderField* nativeInstance, float value);
-		static void internal_setTint(ScriptGUISliderField* nativeInstance, Color* color);
-		static void internal_setRange(ScriptGUISliderField* nativeInstance, float min, float max);
-		static void internal_setStep(ScriptGUISliderField* nativeInstance, float step);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUISliderField. */
+	class BS_SCR_BED_EXPORT ScriptGUISliderField : public TScriptGUIElement<ScriptGUISliderField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUISliderField")
+
+	private:
+		ScriptGUISliderField(MonoObject* instance, GUISliderField* sliderField);
+
+		/**
+		 * Triggered when the value in the native slider field changes.
+		 *
+		 * @param[in]	instance	Managed GUISliderField instance.
+		 * @param[in]	newValue	New field value.
+		 */
+		static void onChanged(MonoObject* instance, float newValue);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, float min, float max, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static float internal_getValue(ScriptGUISliderField* nativeInstance);
+		static void internal_setValue(ScriptGUISliderField* nativeInstance, float value);
+		static void internal_setTint(ScriptGUISliderField* nativeInstance, Color* color);
+		static void internal_setRange(ScriptGUISliderField* nativeInstance, float min, float max);
+		static void internal_setStep(ScriptGUISliderField* nativeInstance, float step);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+	};
+
+	/** @} */
 }

+ 56 - 52
Source/SBansheeEditor/Include/BsScriptGUITextField.h

@@ -1,53 +1,57 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUITextField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native text field changes.
-		 *
-		 * @param	instance	Managed GUITextField instance.
-		 * @param	newValue	New string value.
-		 */
-		static void onChanged(MonoObject* instance, const WString& newValue);
-
-		/**
-		 * @brief	Triggered when the user confirms input in the native text field.
-		 *
-		 * @param	instance	Managed GUITextField instance.
-		 */
-		static void onConfirmed(MonoObject* instance);
-
-		ScriptGUITextField(MonoObject* instance, GUITextField* textField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUITextField* nativeInstance, MonoString** output);
-		static void internal_setValue(ScriptGUITextField* nativeInstance, MonoString* value);
-		static void internal_hasInputFocus(ScriptGUITextField* nativeInstance, bool* output);
-		static void internal_setTint(ScriptGUITextField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
-		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-		static OnConfirmedThunkDef onConfirmedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUITextField. */
+	class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextField")
+
+	private:
+		/**
+		 * Triggered when the value in the native text field changes.
+		 *
+		 * @param[in]	instance	Managed GUITextField instance.
+		 * @param[in]	newValue	New string value.
+		 */
+		static void onChanged(MonoObject* instance, const WString& newValue);
+
+		/**
+		 * Triggered when the user confirms input in the native text field.
+		 *
+		 * @param[in]	instance	Managed GUITextField instance.
+		 */
+		static void onConfirmed(MonoObject* instance);
+
+		ScriptGUITextField(MonoObject* instance, GUITextField* textField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUITextField* nativeInstance, MonoString** output);
+		static void internal_setValue(ScriptGUITextField* nativeInstance, MonoString* value);
+		static void internal_hasInputFocus(ScriptGUITextField* nativeInstance, bool* output);
+		static void internal_setTint(ScriptGUITextField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
+		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+		static OnConfirmedThunkDef onConfirmedThunk;
+	};
+
+	/** @} */
 }

+ 52 - 51
Source/SBansheeEditor/Include/BsScriptGUITextureField.h

@@ -1,52 +1,53 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUITextureField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native texture field changes.
-		 *
-		 * @param	instance	Managed GUITextureField instance.
-		 * @param	newHandle	Handle of the new texture.
-		 */
-		static void onChanged(MonoObject* instance, const WeakResourceHandle<Texture>& newHandle);
-
-		/**
-		 * @brief	Retrieves a managed instance of the specified native texture.
-		 *			Will return null if one doesn't exist.
-		 */
-		static MonoObject* nativeToManagedResource(const HTexture& instance);
-
-		ScriptGUITextureField(MonoObject* instance, GUITextureField* textureField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUITextureField* nativeInstance, MonoObject** output);
-		static void internal_setValue(ScriptGUITextureField* nativeInstance, MonoObject* value);
-		static void internal_getValueRef(ScriptGUITextureField* nativeInstance, MonoObject** output);
-		static void internal_setValueRef(ScriptGUITextureField* nativeInstance, MonoObject* value);
-		static void internal_setTint(ScriptGUITextureField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUITextureField. */
+	class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
+
+	private:
+		/**
+		 * Triggered when the value in the native texture field changes.
+		 *
+		 * @param[in]	instance	Managed GUITextureField instance.
+		 * @param[in]	newHandle	Handle of the new texture.
+		 */
+		static void onChanged(MonoObject* instance, const WeakResourceHandle<Texture>& newHandle);
+
+		/** Retrieves a managed instance of the specified native texture. Will return null if one doesn't exist. */
+		static MonoObject* nativeToManagedResource(const HTexture& instance);
+
+		ScriptGUITextureField(MonoObject* instance, GUITextureField* textureField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUITextureField* nativeInstance, MonoObject** output);
+		static void internal_setValue(ScriptGUITextureField* nativeInstance, MonoObject* value);
+		static void internal_getValueRef(ScriptGUITextureField* nativeInstance, MonoObject** output);
+		static void internal_setValueRef(ScriptGUITextureField* nativeInstance, MonoObject* value);
+		static void internal_setTint(ScriptGUITextureField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+	};
+
+	/** @} */
 }

+ 46 - 42
Source/SBansheeEditor/Include/BsScriptGUIToggleField.h

@@ -1,43 +1,47 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIToggleField.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
-
-	private:
-		/**
-		 * @brief	Triggered when the value in the native toggle field changes.
-		 *
-		 * @param	instance	Managed GUIToggleField instance.
-		 * @param	newValue	Is the toggle active.
-		 */
-		static void onChanged(MonoObject* instance, bool newValue);
-
-		ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
-
-		static void internal_getValue(ScriptGUIToggleField* nativeInstance, bool* output);
-		static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
-		static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color* color);
-
-		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
-
-		static OnChangedThunkDef onChangedThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptGUIElement.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for GUIToggleField. */
+	class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
+
+	private:
+		/**
+		 * Triggered when the value in the native toggle field changes.
+		 *
+		 * @param[in]	instance	Managed GUIToggleField instance.
+		 * @param[in]	newValue	Is the toggle active.
+		 */
+		static void onChanged(MonoObject* instance, bool newValue);
+
+		ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+			MonoString* style, MonoArray* guiOptions, bool withTitle);
+
+		static void internal_getValue(ScriptGUIToggleField* nativeInstance, bool* output);
+		static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
+		static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color* color);
+
+		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
+
+		static OnChangedThunkDef onChangedThunk;
+	};
+
+	/** @} */
 }

+ 11 - 7
Source/SBansheeEditor/Include/BsScriptGUIVector2Field.h

@@ -7,9 +7,11 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIVector2Field.
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
 	 */
+
+	/**	Interop class between C++ & CLR for GUIVector2Field. */
 	class BS_SCR_BED_EXPORT ScriptGUIVector2Field : public TScriptGUIElement<ScriptGUIVector2Field>
 	{
 	public:
@@ -17,17 +19,17 @@ namespace BansheeEngine
 
 	private:
 		/**
-		 * @brief	Triggered when the value in the native vector field changes.
+		 * Triggered when the value in the native vector field changes.
 		 *
-		 * @param	instance	Managed GUIVector2Field instance.
-		 * @param	newValue	New vector value.
+		 * @param[in]	instance	Managed GUIVector2Field instance.
+		 * @param[in]	newValue	New vector value.
 		 */
 		static void onChanged(MonoObject* instance, const Vector2& newValue);
 
 		/**
-		 * @brief	Triggered when the user confirms input in the native vector field.
+		 * Triggered when the user confirms input in the native vector field.
 		 *
-		 * @param	instance	Managed GUIVector2Field instance.
+		 * @param[in]	instance	Managed GUIVector2Field instance.
 		 */
 		static void onConfirmed(MonoObject* instance);
 
@@ -50,4 +52,6 @@ namespace BansheeEngine
 		static OnChangedThunkDef onChangedThunk;
 		static OnConfirmedThunkDef onConfirmedThunk;
 	};
+
+	/** @} */
 }

+ 11 - 7
Source/SBansheeEditor/Include/BsScriptGUIVector3Field.h

@@ -7,9 +7,11 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIVector3Field.
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
 	 */
+
+	/**	Interop class between C++ & CLR for GUIVector3Field. */
 	class BS_SCR_BED_EXPORT ScriptGUIVector3Field : public TScriptGUIElement<ScriptGUIVector3Field>
 	{
 	public:
@@ -17,17 +19,17 @@ namespace BansheeEngine
 
 	private:
 		/**
-		 * @brief	Triggered when the value in the native vector field changes.
+		 * Triggered when the value in the native vector field changes.
 		 *
-		 * @param	instance	Managed GUIVector3Field instance.
-		 * @param	newValue	New vector value.
+		 * @param[in]	instance	Managed GUIVector3Field instance.
+		 * @param[in]	newValue	New vector value.
 		 */
 		static void onChanged(MonoObject* instance, const Vector3& newValue);
 
 		/**
-		 * @brief	Triggered when the user confirms input in the native vector field.
+		 * Triggered when the user confirms input in the native vector field.
 		 *
-		 * @param	instance	Managed GUIVector3Field instance.
+		 * @param[in]	instance	Managed GUIVector3Field instance.
 		 */
 		static void onConfirmed(MonoObject* instance);
 
@@ -50,4 +52,6 @@ namespace BansheeEngine
 		static OnChangedThunkDef onChangedThunk;
 		static OnConfirmedThunkDef onConfirmedThunk;
 	};
+
+	/** @} */
 }

+ 11 - 7
Source/SBansheeEditor/Include/BsScriptGUIVector4Field.h

@@ -7,9 +7,11 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIVector4Field.
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
 	 */
+
+	/**	Interop class between C++ & CLR for GUIVector4Field. */
 	class BS_SCR_BED_EXPORT ScriptGUIVector4Field : public TScriptGUIElement<ScriptGUIVector4Field>
 	{
 	public:
@@ -17,17 +19,17 @@ namespace BansheeEngine
 
 	private:
 		/**
-		 * @brief	Triggered when the value in the native vector field changes.
+		 * Triggered when the value in the native vector field changes.
 		 *
-		 * @param	instance	Managed GUIVector4Field instance.
-		 * @param	newValue	New vector value.
+		 * @param[in]	instance	Managed GUIVector4Field instance.
+		 * @param[in]	newValue	New vector value.
 		 */
 		static void onChanged(MonoObject* instance, const Vector4& newValue);
 
 		/**
-		 * @brief	Triggered when the user confirms input in the native vector field.
+		 * Triggered when the user confirms input in the native vector field.
 		 *
-		 * @param	instance	Managed GUIVector4Field instance.
+		 * @param[in]	instance	Managed GUIVector4Field instance.
 		 */
 		static void onConfirmed(MonoObject* instance);
 
@@ -50,4 +52,6 @@ namespace BansheeEngine
 		static OnChangedThunkDef onChangedThunk;
 		static OnConfirmedThunkDef onConfirmedThunk;
 	};
+
+	/** @} */
 }

+ 69 - 71
Source/SBansheeEditor/Include/BsScriptGizmoManager.h

@@ -1,72 +1,70 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Available flags to be used when defining gizmos.
-	 */
-	// Note: Must match the C# enum DrawGizmoFlags
-	enum class DrawGizmoFlags
-	{
-		Selected = 0x01, /**< Gizmo is only displayed when its scene object is selected. */
-		ParentSelected = 0x02, /**< Gizmo is only displayed when its parent scene object is selected. */
-		NotSelected = 0x04, /**< Gizmo is only displayed when its scene object is not selected. */
-		Pickable = 0x08 /**< Gizmo can be clicked on in scene view, which will select its scene object. */
-	};
-
-	/** 
-	 * Manages all active managed gizmo methods. Finds all gizmos methods in loaded assemblies, and calls them every frame. 
-	 */
-	class BS_SCR_BED_EXPORT ScriptGizmoManager : public Module<ScriptGizmoManager>
-	{
-		/**
-		 * @brief	Data about a managed gizmo method.
-		 */
-		struct GizmoData
-		{
-			MonoClass* componentType; /**< Component the gizmo method belongs to. */
-			MonoMethod* drawGizmosMethod; /**< Method that displays the gizmo. */
-			UINT32 flags; /**< Gizmo flags of type DrawGizmoFlags that control gizmo properties. */
-		};
-
-	public:
-		ScriptGizmoManager(ScriptAssemblyManager& scriptObjectManager);
-		~ScriptGizmoManager();
-
-		/**
-		 * @brief	Iterates over all managed gizmos, calls their draw methods and registers
-		 *			the gizmos with the native GizmoManager.
-		 */
-		void update();
-
-	private:
-		/**
-		 * @brief	Finds all gizmo methods (marked with the DrawGizmo attribute). Clears any previously found methods.
-		 */
-		void reloadAssemblyData();
-
-		/**
-		 * @brief	Checks is the provided method a valid gizmo draw method and if it is, returns
-		 *			properties of that method.
-		 *
-		 * @param	method			Method to check.
-		 * @param	componentType	Output parameter containing the component the method is part of. Only valid if this method returns true.
-		 * @param	drawGizmoFlags	Output parameters containing optional flags that control gizmo properties. Only valid if this method returns true.
-		 *
-		 * @return	True if the method is a valid draw gizmo method.
-		 */
-		bool isValidDrawGizmoMethod(MonoMethod* method, MonoClass*& componentType, UINT32& drawGizmoFlags);
-
-		ScriptAssemblyManager& mScriptObjectManager;
-		HEvent mDomainLoadedConn;
-
-		MonoClass* mDrawGizmoAttribute;
-		MonoField* mFlagsField;
-		Map<String, GizmoData> mGizmoDrawers;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Available flags to be used when defining gizmos. */
+	enum class DrawGizmoFlags // Note: Must match the C# enum DrawGizmoFlags
+	{
+		Selected = 0x01, /**< Gizmo is only displayed when its scene object is selected. */
+		ParentSelected = 0x02, /**< Gizmo is only displayed when its parent scene object is selected. */
+		NotSelected = 0x04, /**< Gizmo is only displayed when its scene object is not selected. */
+		Pickable = 0x08 /**< Gizmo can be clicked on in scene view, which will select its scene object. */
+	};
+
+	/** 
+	 * Manages all active managed gizmo methods. Finds all gizmos methods in loaded assemblies, and calls them every frame. 
+	 */
+	class BS_SCR_BED_EXPORT ScriptGizmoManager : public Module<ScriptGizmoManager>
+	{
+		/**	Data about a managed gizmo method. */
+		struct GizmoData
+		{
+			MonoClass* componentType; /**< Component the gizmo method belongs to. */
+			MonoMethod* drawGizmosMethod; /**< Method that displays the gizmo. */
+			UINT32 flags; /**< Gizmo flags of type DrawGizmoFlags that control gizmo properties. */
+		};
+
+	public:
+		ScriptGizmoManager(ScriptAssemblyManager& scriptObjectManager);
+		~ScriptGizmoManager();
+
+		/**
+		 * Iterates over all managed gizmos, calls their draw methods and registers the gizmos with the native GizmoManager.
+		 */
+		void update();
+
+	private:
+		/**	Finds all gizmo methods (marked with the DrawGizmo attribute). Clears any previously found methods. */
+		void reloadAssemblyData();
+
+		/**
+		 * Checks is the provided method a valid gizmo draw method and if it is, returns properties of that method.
+		 *
+		 * @param[in]	method			Method to check.
+		 * @param[in]	componentType	Output parameter containing the component the method is part of. Only valid if this
+		 *								method returns true.
+		 * @param[in]	drawGizmoFlags	Output parameters containing optional flags that control gizmo properties. Only
+		 *								valid if this method returns true.
+		 * @return						True if the method is a valid draw gizmo method.
+		 */
+		bool isValidDrawGizmoMethod(MonoMethod* method, MonoClass*& componentType, UINT32& drawGizmoFlags);
+
+		ScriptAssemblyManager& mScriptObjectManager;
+		HEvent mDomainLoadedConn;
+
+		MonoClass* mDrawGizmoAttribute;
+		MonoField* mFlagsField;
+		Map<String, GizmoData> mGizmoDrawers;
+	};
+
+	/** @} */
 }

+ 6 - 2
Source/SBansheeEditor/Include/BsScriptGizmos.h

@@ -10,9 +10,11 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Interop class between C++ & CLR for GizmoManager.
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
 	 */
+
+	/**	Interop class between C++ & CLR for GizmoManager. */
 	class BS_SCR_BED_EXPORT ScriptGizmos : public ScriptObject<ScriptGizmos>
 	{
 	public:
@@ -40,4 +42,6 @@ namespace BansheeEngine
 		static void internal_DrawIcon(Vector3* position, MonoObject* image, bool fixedScale);
 		static void internal_DrawText(Vector3* position, MonoString* text, ScriptFont* font, int size);
 	};
+
+	/** @} */
 }

+ 46 - 42
Source/SBansheeEditor/Include/BsScriptHandleDrawing.h

@@ -1,43 +1,47 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsVector3.h"
-#include "BsMatrix4.h"
-#include "BsRect3.h"
-#include "BsColor.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for HandleDrawManager.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleDrawing : public ScriptObject <ScriptHandleDrawing>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleDrawing")
-
-	private:
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_SetColor(Color* color);
-		static void internal_SetTransform(Matrix4* transform);
-		static void internal_SetLayer(UINT64 layer);
-
-		static void internal_DrawCube(Vector3* position, Vector3* extents, float size);
-		static void internal_DrawSphere(Vector3* position, float radius, float size);
-		static void internal_DrawWireCube(Vector3* position, Vector3* extents, float size);
-		static void internal_DrawWireSphere(Vector3* position, float radius, float size);
-		static void internal_DrawLine(Vector3* start, Vector3* end, float size);
-		static void internal_DrawCone(Vector3* coneBase, Vector3* normal, float height, float radius, float size);
-		static void internal_DrawDisc(Vector3* position, Vector3* normal, float radius, float size);
-		static void internal_DrawWireDisc(Vector3* position, Vector3* normal, float radius, float size);
-		static void internal_DrawArc(Vector3* position, Vector3* normal, float radius, Degree* startAngle, Degree* amountAngle, float size);
-		static void internal_DrawWireArc(Vector3* position, Vector3* normal, float radius, Degree* startAngle, Degree* amountAngle, float size);
-		static void internal_DrawRect(Vector3* center, Vector3* horzAxis, Vector3* vertAxis, float extentH, float extentV, float size);
-		static void internal_DrawText(Vector3* position, MonoString* text, ScriptFont* font, int fontSize, float size);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsVector3.h"
+#include "BsMatrix4.h"
+#include "BsRect3.h"
+#include "BsColor.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for HandleDrawManager. */
+	class BS_SCR_BED_EXPORT ScriptHandleDrawing : public ScriptObject <ScriptHandleDrawing>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleDrawing")
+
+	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_SetColor(Color* color);
+		static void internal_SetTransform(Matrix4* transform);
+		static void internal_SetLayer(UINT64 layer);
+
+		static void internal_DrawCube(Vector3* position, Vector3* extents, float size);
+		static void internal_DrawSphere(Vector3* position, float radius, float size);
+		static void internal_DrawWireCube(Vector3* position, Vector3* extents, float size);
+		static void internal_DrawWireSphere(Vector3* position, float radius, float size);
+		static void internal_DrawLine(Vector3* start, Vector3* end, float size);
+		static void internal_DrawCone(Vector3* coneBase, Vector3* normal, float height, float radius, float size);
+		static void internal_DrawDisc(Vector3* position, Vector3* normal, float radius, float size);
+		static void internal_DrawWireDisc(Vector3* position, Vector3* normal, float radius, float size);
+		static void internal_DrawArc(Vector3* position, Vector3* normal, float radius, Degree* startAngle, Degree* amountAngle, float size);
+		static void internal_DrawWireArc(Vector3* position, Vector3* normal, float radius, Degree* startAngle, Degree* amountAngle, float size);
+		static void internal_DrawRect(Vector3* center, Vector3* horzAxis, Vector3* vertAxis, float extentH, float extentV, float size);
+		static void internal_DrawText(Vector3* position, MonoString* text, ScriptFont* font, int fontSize, float size);
+	};
+
+	/** @} */
 }

+ 138 - 147
Source/SBansheeEditor/Include/BsScriptHandleManager.h

@@ -1,148 +1,139 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsHandleManager.h"
-#include <mono/jit/jit.h>
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Renders, updates and manipulates handles declared in managed code.
-	 *			Managed code handles have a [CustomHandle] attribute and must implement
-	 *			BansheeEditor.Handle.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleManager : public HandleManager
-	{
-		/**
-		 * @brief	Contains data about a manage type that draws and handles
-		 *			interaction with a custom handle.
-		 */
-		struct CustomHandleData
-		{
-			MonoClass* handleType;
-			MonoClass* componentType;
-			MonoMethod* ctor;
-		};
-
-		/**
-		 * @brief	Data about an active instance of a managed custom handle object.
-		 *			Active handle means its scene object is currently selected and the
-		 *			handle is displayed and can be interacted with.
-		 */
-		struct ActiveCustomHandleData
-		{
-			MonoObject* object;
-			uint32_t gcHandle;
-		};
-
-		/**
-		 * @brief	Data about all active managed custom handle objects
-		 *			for a specific scene object. Active handle means its 
-		 *			scene object is currently selected and the handle is displayed 
-		 *			and can be interacted with.
-		 */
-		struct ActiveCustomHandles
-		{
-			HSceneObject selectedObject;
-			Vector<ActiveCustomHandleData> handles;
-		};
-
-	public:
-		ScriptHandleManager(ScriptAssemblyManager& scriptObjectManager);
-		~ScriptHandleManager();
-
-	protected:
-		/**
-		 * @copydoc	HandleManager::triggerPreInput
-		 */
-		void triggerPreInput() override;
-
-		/**
-		 * @copydoc	HandleManager::triggerPostInput
-		 */
-		void triggerPostInput() override;
-
-		/**
-		 * @copydoc	HandleManager::queueDrawCommands
-		 */
-		void queueDrawCommands() override;
-
-		/**   
-		 * @brief	 Clears references to all managed types and objects. Must be called before loadAssemblyData if 
-		 * 			 loadAssemblyData was called previously.
-		 */
-		void clearAssemblyData();
-
-		/**
-		 * @brief	Loads internal managed assembly types and finds all custom handle classes.
-		 *			Must be called after construction and after assembly reload.
-		 */
-		void loadAssemblyData();
-
-		/**
-		 * @brief	Checks is the provided type a valid custom handle class. Custom handles
-		 *			must have a [CustomHandle] attribute and must implement BansheeEditor.Handle.
-		 *
-		 * @param	type			Type to check.
-		 * @param	componentType	Component type for which the handle should be displayed for. Handle will not
-		 *							be displayed unless a component of this type is selected. Only valid if method returns true.
-		 * @param	ctor			Constructor method for the handle type. Only valid if method returns true.
-		 *
-		 * @return	True if the type is a valid custom handle type.
-		 */
-		bool isValidHandleType(MonoClass* type, MonoClass*& componentType, MonoMethod*& ctor) const;
-
-		/**
-		 * @brief	Triggers the PreInput method on the provided Handle object. Pre
-		 *			input happens before any handles are selected or moved and allows you
-		 *			to position the handles or prepare them in some other way.
-		 */
-		void callPreInput(MonoObject* instance);
-
-		/**
-		 * @brief	Triggers the PostInput method on the provided Handle object.
-		 *			Post input happens after we know in what way has the user interacted
-		 *			with the handles this frame.
-		 */
-		void callPostInput(MonoObject* instance);
-
-		/**
-		 * @brief	Triggers the Draw method on the provided Handle object. Draw allows
-		 *			you to draw the visual representation of the handles. Called after PostInput.
-		 */
-		void callDraw(MonoObject* instance);
-
-		/**
-		 * @brief	Triggers the Destroy method on the provided Handle object. Destroy
-		 *			is called when the handle is no longer being displayed.
-		 */
-		void callDestroy(MonoObject* instance);
-
-		ScriptAssemblyManager& mScriptObjectManager;
-		HEvent mDomainUnloadConn;
-		HEvent mDomainLoadConn;
-
-		Map<String, CustomHandleData> mHandles;
-
-		ActiveCustomHandles mActiveHandleData;
-		Vector<MonoClass*> mGlobalHandlesToCreate;
-		Vector<ActiveCustomHandleData> mActiveGlobalHandles;
-
-		MonoObject* mDefaultHandleManager = nullptr;
-		uint32_t mDefaultHandleManagerGCHandle = 0;
-
-		MonoClass* mCustomHandleAttribute = nullptr;
-		MonoField* mTypeField = nullptr;
-		MonoClass* mHandleBaseClass = nullptr;
-		MonoClass* mDefaultHandleManagerClass = nullptr;
-
-		typedef void(__stdcall *DestroyThunkDef) (MonoObject*, MonoException**);
-
-		MonoMethod* mPreInputMethod;
-		MonoMethod* mPostInputMethod;
-		MonoMethod* mDrawMethod;
-		DestroyThunkDef mDestroyThunk;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsHandleManager.h"
+#include <mono/jit/jit.h>
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * Renders, updates and manipulates handles declared in managed code. Managed code handles have a [CustomHandle]
+	 * attribute and must implement BansheeEditor.Handle.
+	 */
+	class BS_SCR_BED_EXPORT ScriptHandleManager : public HandleManager
+	{
+		/** Contains data about a manage type that draws and handles interaction with a custom handle. */
+		struct CustomHandleData
+		{
+			MonoClass* handleType;
+			MonoClass* componentType;
+			MonoMethod* ctor;
+		};
+
+		/**
+		 * Data about an active instance of a managed custom handle object. Active handle means its scene object is
+		 * currently selected and the handle is displayed and can be interacted with.
+		 */
+		struct ActiveCustomHandleData
+		{
+			MonoObject* object;
+			uint32_t gcHandle;
+		};
+
+		/**
+		 * Data about all active managed custom handle objects for a specific scene object. Active handle means its 
+		 * scene object is currently selected and the handle is displayed and can be interacted with.
+		 */
+		struct ActiveCustomHandles
+		{
+			HSceneObject selectedObject;
+			Vector<ActiveCustomHandleData> handles;
+		};
+
+	public:
+		ScriptHandleManager(ScriptAssemblyManager& scriptObjectManager);
+		~ScriptHandleManager();
+
+	protected:
+		/** @copydoc HandleManager::triggerPreInput */
+		void triggerPreInput() override;
+
+		/** @copydoc HandleManager::triggerPostInput */
+		void triggerPostInput() override;
+
+		/** @copydoc HandleManager::queueDrawCommands */
+		void queueDrawCommands() override;
+
+		/**   
+		 * Clears references to all managed types and objects. Must be called before loadAssemblyData() if 
+		 * loadAssemblyData() was called previously.
+		 */
+		void clearAssemblyData();
+
+		/**
+		 * Loads internal managed assembly types and finds all custom handle classes. Must be called after construction and
+		 * after assembly reload.
+		 */
+		void loadAssemblyData();
+
+		/**
+		 * Checks is the provided type a valid custom handle class. Custom handles must have a [CustomHandle] attribute and
+		 * must implement BansheeEditor.Handle.
+		 *
+		 * @param[in]	type			Type to check.
+		 * @param[in]	componentType	Component type for which the handle should be displayed for. Handle will not
+		 *								be displayed unless a component of this type is selected. Only valid if method
+		 *								returns true.
+		 * @param[in]	ctor			Constructor method for the handle type. Only valid if method returns true.
+		 * @return						True if the type is a valid custom handle type.
+		 */
+		bool isValidHandleType(MonoClass* type, MonoClass*& componentType, MonoMethod*& ctor) const;
+
+		/**
+		 * Triggers the PreInput method on the provided Handle object. Pre input happens before any handles are selected
+		 * or moved and allows you to position the handles or prepare them in some other way.
+		 */
+		void callPreInput(MonoObject* instance);
+
+		/**
+		 * Triggers the PostInput method on the provided Handle object. Post input happens after we know in what way has the
+		 * user interacted with the handles this frame.
+		 */
+		void callPostInput(MonoObject* instance);
+
+		/**
+		 * Triggers the Draw method on the provided Handle object. Draw allows you to draw the visual representation of the
+		 * handles. Called after PostInput.
+		 */
+		void callDraw(MonoObject* instance);
+
+		/**
+		 * Triggers the Destroy method on the provided Handle object. Destroy is called when the handle is no longer being
+		 * displayed.
+		 */
+		void callDestroy(MonoObject* instance);
+
+		ScriptAssemblyManager& mScriptObjectManager;
+		HEvent mDomainUnloadConn;
+		HEvent mDomainLoadConn;
+
+		Map<String, CustomHandleData> mHandles;
+
+		ActiveCustomHandles mActiveHandleData;
+		Vector<MonoClass*> mGlobalHandlesToCreate;
+		Vector<ActiveCustomHandleData> mActiveGlobalHandles;
+
+		MonoObject* mDefaultHandleManager = nullptr;
+		uint32_t mDefaultHandleManagerGCHandle = 0;
+
+		MonoClass* mCustomHandleAttribute = nullptr;
+		MonoField* mTypeField = nullptr;
+		MonoClass* mHandleBaseClass = nullptr;
+		MonoClass* mDefaultHandleManagerClass = nullptr;
+
+		typedef void(__stdcall *DestroyThunkDef) (MonoObject*, MonoException**);
+
+		MonoMethod* mPreInputMethod;
+		MonoMethod* mPostInputMethod;
+		MonoMethod* mDrawMethod;
+		DestroyThunkDef mDestroyThunk;
+	};
+
+	/** @} */
 }

+ 67 - 67
Source/SBansheeEditor/Include/BsScriptHandleSlider.h

@@ -1,68 +1,68 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsHandleSlider.h"
-#include "BsQuaternion.h"
-#include "BsVector3.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Base class for all C++/CLR interop objects that deal with handle sliders.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSliderBase : public ScriptObjectBase
-	{
-	public:
-		ScriptHandleSliderBase(MonoObject* managedInstance);
-		virtual ~ScriptHandleSliderBase();
-
-		/**
-		 * @brief	Returns the internal native handle slider.
-		 */
-		virtual HandleSlider* getSlider() const = 0;
-
-	protected:
-		friend class ScriptHandleSlider;
-		friend class ScriptHandleSliderManager;
-
-		/**
-		 * @brief	Destroys the internal native handle slider and unregisters it with
-		 *			with handle manager.
-		 */
-		void destroy();
-
-		/**
-		 * @brief	Destroys the internal native handle slider.
-		 */
-		virtual void destroyInternal() = 0;
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for HandleSlider.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSlider : public ScriptObject <ScriptHandleSlider>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSlider")
-
-	private:
-		ScriptHandleSlider(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Destroy(ScriptHandleSliderBase* nativeInstance);
-		static void internal_GetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
-		static void internal_SetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
-		static void internal_GetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
-		static void internal_SetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
-		static void internal_GetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
-		static void internal_SetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
-		static bool internal_GetEnabled(ScriptHandleSliderBase* nativeInstance);
-		static void internal_SetEnabled(ScriptHandleSliderBase* nativeInstance, bool value);
-		static void internal_GetState(ScriptHandleSliderBase* nativeInstance, HandleSlider::State* value);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsHandleSlider.h"
+#include "BsQuaternion.h"
+#include "BsVector3.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Base class for all C++/CLR interop objects that deal with handle sliders. */
+	class BS_SCR_BED_EXPORT ScriptHandleSliderBase : public ScriptObjectBase
+	{
+	public:
+		ScriptHandleSliderBase(MonoObject* managedInstance);
+		virtual ~ScriptHandleSliderBase();
+
+		/**	Returns the internal native handle slider. */
+		virtual HandleSlider* getSlider() const = 0;
+
+	protected:
+		friend class ScriptHandleSlider;
+		friend class ScriptHandleSliderManager;
+
+		/** Destroys the internal native handle slider and unregisters it with with handle manager. */
+		void destroy();
+
+		/**	Destroys the internal native handle slider. */
+		virtual void destroyInternal() = 0;
+	};
+
+	/** @} */
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for HandleSlider. */
+	class BS_SCR_BED_EXPORT ScriptHandleSlider : public ScriptObject <ScriptHandleSlider>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSlider")
+
+	private:
+		ScriptHandleSlider(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Destroy(ScriptHandleSliderBase* nativeInstance);
+		static void internal_GetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
+		static void internal_SetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
+		static void internal_GetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
+		static void internal_SetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
+		static void internal_GetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
+		static void internal_SetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
+		static bool internal_GetEnabled(ScriptHandleSliderBase* nativeInstance);
+		static void internal_SetEnabled(ScriptHandleSliderBase* nativeInstance, bool value);
+		static void internal_GetState(ScriptHandleSliderBase* nativeInstance, HandleSlider::State* value);
+	};
+
+	/** @} */
 }

+ 45 - 45
Source/SBansheeEditor/Include/BsScriptHandleSliderDisc.h

@@ -1,46 +1,46 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsScriptHandleSlider.h"
-#include "BsHandleSliderDisc.h"
-#include "BsVector3.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for HandleSliderDisc.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSliderDisc : public ScriptObject <ScriptHandleSliderDisc, ScriptHandleSliderBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderDisc")
-
-	protected:
-		/**
-		 * @copydoc	ScriptHandleSliderBase::getSlider
-		 */
-		virtual HandleSlider* getSlider() const override { return mSlider; }
-
-		/**
-		 * @copydoc	ScriptHandleSliderBase::destroyInternal
-		 */
-		virtual void destroyInternal() override;
-
-	private:
-		ScriptHandleSliderDisc(MonoObject* instance, const Vector3& normal, float radius, bool fixedScale, UINT64 layer);
-		~ScriptHandleSliderDisc();
-
-		HandleSliderDisc* mSlider;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, Vector3* normal, float radius, bool fixedScale, UINT64 layer);
-		static void internal_GetDelta(ScriptHandleSliderDisc* nativeInstance, float* value);
-		static void internal_GetStartAngle(ScriptHandleSliderDisc* nativeInstance, float* value);
-		static void internal_SetCutoffPlane(ScriptHandleSliderDisc* nativeInstance, float value, bool enabled);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsScriptHandleSlider.h"
+#include "BsHandleSliderDisc.h"
+#include "BsVector3.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for HandleSliderDisc. */
+	class BS_SCR_BED_EXPORT ScriptHandleSliderDisc : public ScriptObject <ScriptHandleSliderDisc, ScriptHandleSliderBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderDisc")
+
+	protected:
+		/** @copydoc ScriptHandleSliderBase::getSlider */
+		virtual HandleSlider* getSlider() const override { return mSlider; }
+
+		/** @copydoc ScriptHandleSliderBase::destroyInternal */
+		virtual void destroyInternal() override;
+
+	private:
+		ScriptHandleSliderDisc(MonoObject* instance, const Vector3& normal, float radius, bool fixedScale, UINT64 layer);
+		~ScriptHandleSliderDisc();
+
+		HandleSliderDisc* mSlider;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, Vector3* normal, float radius, bool fixedScale, UINT64 layer);
+		static void internal_GetDelta(ScriptHandleSliderDisc* nativeInstance, float* value);
+		static void internal_GetStartAngle(ScriptHandleSliderDisc* nativeInstance, float* value);
+		static void internal_SetCutoffPlane(ScriptHandleSliderDisc* nativeInstance, float value, bool enabled);
+	};
+
+	/** @} */
 }

+ 43 - 43
Source/SBansheeEditor/Include/BsScriptHandleSliderLine.h

@@ -1,44 +1,44 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsScriptHandleSlider.h"
-#include "BsHandleSliderLine.h"
-#include "BsVector3.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for HandleSliderLine.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSliderLine : public ScriptObject <ScriptHandleSliderLine, ScriptHandleSliderBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderLine")
-
-	protected:
-		/**
-		 * @copydoc	ScriptHandleSliderBase::getSlider
-		 */
-		virtual HandleSlider* getSlider() const override { return mSlider; }
-
-		/**
-		 * @copydoc	ScriptHandleSliderBase::getSlider
-		 */
-		virtual void destroyInternal() override;
-
-	private:
-		ScriptHandleSliderLine(MonoObject* instance, const Vector3& direction, float length, bool fixedScale, UINT64 layer);
-		~ScriptHandleSliderLine();
-
-		HandleSliderLine* mSlider;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, Vector3* direction, float length, bool fixedScale, UINT64 layer);
-		static void internal_GetDelta(ScriptHandleSliderLine* nativeInstance, float* value);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsScriptHandleSlider.h"
+#include "BsHandleSliderLine.h"
+#include "BsVector3.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for HandleSliderLine. */
+	class BS_SCR_BED_EXPORT ScriptHandleSliderLine : public ScriptObject <ScriptHandleSliderLine, ScriptHandleSliderBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderLine")
+
+	protected:
+		/** @copydoc ScriptHandleSliderBase::getSlider */
+		virtual HandleSlider* getSlider() const override { return mSlider; }
+
+		/** @copydoc ScriptHandleSliderBase::getSlider */
+		virtual void destroyInternal() override;
+
+	private:
+		ScriptHandleSliderLine(MonoObject* instance, const Vector3& direction, float length, bool fixedScale, UINT64 layer);
+		~ScriptHandleSliderLine();
+
+		HandleSliderLine* mSlider;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, Vector3* direction, float length, bool fixedScale, UINT64 layer);
+		static void internal_GetDelta(ScriptHandleSliderLine* nativeInstance, float* value);
+	};
+
+	/** @} */
 }

+ 30 - 30
Source/SBansheeEditor/Include/BsScriptHandleSliderManager.h

@@ -1,31 +1,31 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Tracks all managed handle sliders.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSliderManager : public Module<ScriptHandleSliderManager>
-	{
-	public:
-		~ScriptHandleSliderManager();
-
-		/**
-		 * @brief	Registers a new active managed handle slider.
-		 */
-		void registerSlider(ScriptHandleSliderBase* slider);
-
-		/**
-		 * @brief	Unregisters a managed handle slider when it is destroyed.
-		 */
-		void unregisterSlider(ScriptHandleSliderBase* slider);
-
-	private:
-		Set<ScriptHandleSliderBase*> mSliders;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**	Tracks all managed handle sliders. */
+	class BS_SCR_BED_EXPORT ScriptHandleSliderManager : public Module<ScriptHandleSliderManager>
+	{
+	public:
+		~ScriptHandleSliderManager();
+
+		/**	Registers a new active managed handle slider. */
+		void registerSlider(ScriptHandleSliderBase* slider);
+
+		/**	Unregisters a managed handle slider when it is destroyed. */
+		void unregisterSlider(ScriptHandleSliderBase* slider);
+
+	private:
+		Set<ScriptHandleSliderBase*> mSliders;
+	};
+
+	/** @} */
 }

+ 45 - 45
Source/SBansheeEditor/Include/BsScriptHandleSliderPlane.h

@@ -1,46 +1,46 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsScriptHandleSlider.h"
-#include "BsHandleSliderPlane.h"
-#include "BsVector3.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for HandleSliderPlane.
-	 */
-	class BS_SCR_BED_EXPORT ScriptHandleSliderPlane : public ScriptObject <ScriptHandleSliderPlane, ScriptHandleSliderBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderPlane")
-
-	protected:
-		/**
-		 * @copydoc	ScriptHandleSliderBase::getSlider
-		 */
-		virtual HandleSlider* getSlider() const override { return mSlider; }
-
-		/**
-		 * @copydoc	ScriptHandleSliderBase::getSlider
-		 */
-		virtual void destroyInternal() override;
-
-	private:
-		ScriptHandleSliderPlane(MonoObject* instance, const Vector3& dir1, const Vector3& dir2, float length, 
-			bool fixedScale, UINT64 layer);
-		~ScriptHandleSliderPlane();
-
-		HandleSliderPlane* mSlider;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, Vector3* dir1, Vector3* dir2, float length, 
-			bool fixedScale, UINT64 layer);
-		static void internal_GetDelta(ScriptHandleSliderPlane* nativeInstance, Vector2* value);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsScriptHandleSlider.h"
+#include "BsHandleSliderPlane.h"
+#include "BsVector3.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for HandleSliderPlane. */
+	class BS_SCR_BED_EXPORT ScriptHandleSliderPlane : public ScriptObject <ScriptHandleSliderPlane, ScriptHandleSliderBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderPlane")
+
+	protected:
+		/** @copydoc ScriptHandleSliderBase::getSlider */
+		virtual HandleSlider* getSlider() const override { return mSlider; }
+
+		/** @copydoc ScriptHandleSliderBase::getSlider */
+		virtual void destroyInternal() override;
+
+	private:
+		ScriptHandleSliderPlane(MonoObject* instance, const Vector3& dir1, const Vector3& dir2, float length, 
+			bool fixedScale, UINT64 layer);
+		~ScriptHandleSliderPlane();
+
+		HandleSliderPlane* mSlider;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, Vector3* dir1, Vector3* dir2, float length, 
+			bool fixedScale, UINT64 layer);
+		static void internal_GetDelta(ScriptHandleSliderPlane* nativeInstance, Vector2* value);
+	};
+
+	/** @} */
 }

+ 184 - 225
Source/SBansheeEditor/Include/BsScriptImportOptions.h

@@ -1,226 +1,185 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsPixelData.h"
-#include "BsGpuProgram.h"
-
-namespace BansheeEngine
-{
-	enum class FontRenderMode;
-
-	/**
-	 * @brief	Base class for all C++/CLR interop objects wrapping various
-	 *			implementations of ImportOptions.
-	 */
-	class BS_SCR_BED_EXPORT ScriptImportOptionsBase : public ScriptObjectBase
-	{
-	public:
-		/**
-		 * @brief	Returns the internal native import options.
-		 */
-		SPtr<ImportOptions> getImportOptions() const { return mImportOptions; }
-
-	protected:
-		ScriptImportOptionsBase(MonoObject* instance);
-		virtual ~ScriptImportOptionsBase() {}
-
-		SPtr<ImportOptions> mImportOptions;
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ImportOptions.
-	 */
-	class BS_SCR_BED_EXPORT ScriptImportOptions : public ScriptObject <ScriptImportOptions, ScriptImportOptionsBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ImportOptions")
-
-		/**
-		 * @brief	Creates a new managed ImportOptions instance containing
-		 *			the provided import options.
-		 */
-		static MonoObject* create(const SPtr<ImportOptions>& importOptions);
-
-	private:
-		ScriptImportOptions(MonoObject* instance);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for TextureImportOptions.
-	 */
-	class BS_SCR_BED_EXPORT ScriptTextureImportOptions : public ScriptObject<ScriptTextureImportOptions, ScriptImportOptionsBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "TextureImportOptions")
-
-		/**
-		 * @brief	Creates a new managed TextureImportOptions instance containing the 
-		 *			default import options for textures.
-		 */
-		static MonoObject* create();
-
-		/**
-		 * @brief	Creates a new managed TextureImportOptions instance containing 
-		 *			the provided import options.
-		 */
-		static MonoObject* create(const SPtr<TextureImportOptions>& options);
-
-	private:
-		ScriptTextureImportOptions(MonoObject* instance);
-
-		/**
-		 * @brief	Returns the internal native import options.
-		 */
-		SPtr<TextureImportOptions> getTexImportOptions();
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance);
-		static PixelFormat internal_GetPixelFormat(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetPixelFormat(ScriptTextureImportOptions* thisPtr, PixelFormat value);
-		static bool internal_GetGenerateMipmaps(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetGenerateMipmaps(ScriptTextureImportOptions* thisPtr, bool value);
-		static UINT32 internal_GetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr, UINT32 value);
-		static bool internal_GetCPUReadable(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetCPUReadable(ScriptTextureImportOptions* thisPtr, bool value);
-		static bool internal_GetIsSRGB(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetIsSRGB(ScriptTextureImportOptions* thisPtr, bool value);
-	};
-
-	/**
-	* @brief	Interop class between C++ & CLR for MeshImportOptions.
-	*/
-	class BS_SCR_BED_EXPORT ScriptMeshImportOptions : public ScriptObject<ScriptMeshImportOptions, ScriptImportOptionsBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "MeshImportOptions")
-
-		/**
-		 * @brief	Creates a new managed MeshImportOptions instance containing the
-		 *			default import options for textures.
-		 */
-		static MonoObject* create();
-
-		/**
-		 * @brief	Creates a new managed MeshImportOptions instance containing
-		 *			the provided import options.
-		 */
-		static MonoObject* create(const SPtr<MeshImportOptions>& options);
-
-	private:
-		ScriptMeshImportOptions(MonoObject* instance);
-
-		/**
-		* @brief	Returns the internal native import options.
-		*/
-		SPtr<MeshImportOptions> getMeshImportOptions();
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance);
-		static bool internal_GetCPUReadable(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetCPUReadable(ScriptMeshImportOptions* thisPtr, bool value);
-		static bool internal_GetImportNormals(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetImportNormals(ScriptMeshImportOptions* thisPtr, bool value);
-		static bool internal_GetImportTangents(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetImportTangents(ScriptMeshImportOptions* thisPtr, bool value);
-		static bool internal_GetImportSkin(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetImportSkin(ScriptMeshImportOptions* thisPtr, bool value);
-		static bool internal_GetImportAnimation(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetImportAnimation(ScriptMeshImportOptions* thisPtr, bool value);
-		static bool internal_GetImportBlendShapes(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetImportBlendShapes(ScriptMeshImportOptions* thisPtr, bool value);
-		static float internal_GetScale(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetScale(ScriptMeshImportOptions* thisPtr, float value);
-		static int internal_GetCollisionMeshType(ScriptMeshImportOptions* thisPtr);
-		static void internal_SetCollisionMeshType(ScriptMeshImportOptions* thisPtr, int value);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for FontImportOptions.
-	 */
-	class BS_SCR_BED_EXPORT ScriptFontImportOptions : public ScriptObject <ScriptFontImportOptions, ScriptImportOptionsBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FontImportOptions")
-
-		/**
-		 * @brief	Creates a new managed FontImportOptions instance containing the 
-		 *			default import options for fonts.
-		 */
-		static MonoObject* create();
-
-		/**
-		 * @brief	Creates a new managed FontImportOptions instance containing 
-		 *			the provided import options.
-		 */
-		static MonoObject* create(const SPtr<FontImportOptions>& options);
-
-	private:
-		ScriptFontImportOptions(MonoObject* instance);
-
-		/**
-		 * @brief	Returns the internal native import options.
-		 */
-		SPtr<FontImportOptions> getFontImportOptions();
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance);
-		static MonoArray* internal_GetFontSizes(ScriptFontImportOptions* thisPtr);
-		static void internal_SetFontSizes(ScriptFontImportOptions* thisPtr, MonoArray* value);
-		static UINT32 internal_GetDPI(ScriptFontImportOptions* thisPtr);
-		static void internal_SetDPI(ScriptFontImportOptions* thisPtr, UINT32 value);
-		static FontRenderMode internal_GetRenderMode(ScriptFontImportOptions* thisPtr);
-		static void internal_SetRenderMode(ScriptFontImportOptions* thisPtr, FontRenderMode value);
-		static bool internal_GetBold(ScriptFontImportOptions* thisPtr);
-		static void internal_SetBold(ScriptFontImportOptions* thisPtr, bool value);
-		static bool internal_GetItalic(ScriptFontImportOptions* thisPtr);
-		static void internal_SetItalic(ScriptFontImportOptions* thisPtr, bool value);
-		static MonoArray* internal_GetCharRanges(ScriptFontImportOptions* thisPtr);
-		static void internal_SetCharRanges(ScriptFontImportOptions* thisPtr, MonoArray* value);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ScriptCodeImportOptions.
-	 */
-	class BS_SCR_BED_EXPORT ScriptScriptCodeImportOptions : public ScriptObject <ScriptScriptCodeImportOptions, ScriptImportOptionsBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ScriptCodeImportOptions")
-
-		/**
-		 * @brief	Creates a new managed ScriptCodeImportOptions instance containing the 
-		 *			default import options for script code files.
-		 */
-		static MonoObject* create();
-
-		/**
-		 * @brief	Creates a new managed ScriptCodeImportOptions instance containing 
-		 *			the provided import options.
-		 */
-		static MonoObject* create(const SPtr<ScriptCodeImportOptions>& options);
-
-	private:
-		ScriptScriptCodeImportOptions(MonoObject* instance);
-
-		/**
-		 * @brief	Returns the internal native import options.
-		 */
-		SPtr<ScriptCodeImportOptions> getCodeImportOptions();
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance);
-		static bool internal_IsEditorScript(ScriptScriptCodeImportOptions* thisPtr);
-		static void internal_SetEditorScript(ScriptScriptCodeImportOptions* thisPtr, bool value);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsPixelData.h"
+#include "BsGpuProgram.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	enum class FontRenderMode;
+
+	/** Base class for all C++/CLR interop objects wrapping various implementations of ImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptImportOptionsBase : public ScriptObjectBase
+	{
+	public:
+		/**	Returns the internal native import options. */
+		SPtr<ImportOptions> getImportOptions() const { return mImportOptions; }
+
+	protected:
+		ScriptImportOptionsBase(MonoObject* instance);
+		virtual ~ScriptImportOptionsBase() {}
+
+		SPtr<ImportOptions> mImportOptions;
+	};
+
+	/**	Interop class between C++ & CLR for ImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptImportOptions : public ScriptObject <ScriptImportOptions, ScriptImportOptionsBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ImportOptions")
+
+		/** Creates a new managed ImportOptions instance containing the provided import options. */
+		static MonoObject* create(const SPtr<ImportOptions>& importOptions);
+
+	private:
+		ScriptImportOptions(MonoObject* instance);
+	};
+
+	/**	Interop class between C++ & CLR for TextureImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptTextureImportOptions : public ScriptObject<ScriptTextureImportOptions, ScriptImportOptionsBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "TextureImportOptions")
+
+		/** Creates a new managed TextureImportOptions instance containing the default import options for textures. */
+		static MonoObject* create();
+
+		/**	Creates a new managed TextureImportOptions instance containing the provided import options. */
+		static MonoObject* create(const SPtr<TextureImportOptions>& options);
+
+	private:
+		ScriptTextureImportOptions(MonoObject* instance);
+
+		/**	Returns the internal native import options. */
+		SPtr<TextureImportOptions> getTexImportOptions();
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance);
+		static PixelFormat internal_GetPixelFormat(ScriptTextureImportOptions* thisPtr);
+		static void internal_SetPixelFormat(ScriptTextureImportOptions* thisPtr, PixelFormat value);
+		static bool internal_GetGenerateMipmaps(ScriptTextureImportOptions* thisPtr);
+		static void internal_SetGenerateMipmaps(ScriptTextureImportOptions* thisPtr, bool value);
+		static UINT32 internal_GetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr);
+		static void internal_SetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr, UINT32 value);
+		static bool internal_GetCPUReadable(ScriptTextureImportOptions* thisPtr);
+		static void internal_SetCPUReadable(ScriptTextureImportOptions* thisPtr, bool value);
+		static bool internal_GetIsSRGB(ScriptTextureImportOptions* thisPtr);
+		static void internal_SetIsSRGB(ScriptTextureImportOptions* thisPtr, bool value);
+	};
+
+	/**	Interop class between C++ & CLR for MeshImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptMeshImportOptions : public ScriptObject<ScriptMeshImportOptions, ScriptImportOptionsBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "MeshImportOptions")
+
+		/**	Creates a new managed MeshImportOptions instance containing the default import options for textures. */
+		static MonoObject* create();
+
+		/** Creates a new managed MeshImportOptions instance containing the provided import options. */
+		static MonoObject* create(const SPtr<MeshImportOptions>& options);
+
+	private:
+		ScriptMeshImportOptions(MonoObject* instance);
+
+		/**	Returns the internal native import options. */
+		SPtr<MeshImportOptions> getMeshImportOptions();
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance);
+		static bool internal_GetCPUReadable(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetCPUReadable(ScriptMeshImportOptions* thisPtr, bool value);
+		static bool internal_GetImportNormals(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetImportNormals(ScriptMeshImportOptions* thisPtr, bool value);
+		static bool internal_GetImportTangents(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetImportTangents(ScriptMeshImportOptions* thisPtr, bool value);
+		static bool internal_GetImportSkin(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetImportSkin(ScriptMeshImportOptions* thisPtr, bool value);
+		static bool internal_GetImportAnimation(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetImportAnimation(ScriptMeshImportOptions* thisPtr, bool value);
+		static bool internal_GetImportBlendShapes(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetImportBlendShapes(ScriptMeshImportOptions* thisPtr, bool value);
+		static float internal_GetScale(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetScale(ScriptMeshImportOptions* thisPtr, float value);
+		static int internal_GetCollisionMeshType(ScriptMeshImportOptions* thisPtr);
+		static void internal_SetCollisionMeshType(ScriptMeshImportOptions* thisPtr, int value);
+	};
+
+	/**	Interop class between C++ & CLR for FontImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptFontImportOptions : public ScriptObject <ScriptFontImportOptions, ScriptImportOptionsBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FontImportOptions")
+
+		/** Creates a new managed FontImportOptions instance containing the default import options for fonts. */
+		static MonoObject* create();
+
+		/**	Creates a new managed FontImportOptions instance containing the provided import options. */
+		static MonoObject* create(const SPtr<FontImportOptions>& options);
+
+	private:
+		ScriptFontImportOptions(MonoObject* instance);
+
+		/**	Returns the internal native import options. */
+		SPtr<FontImportOptions> getFontImportOptions();
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance);
+		static MonoArray* internal_GetFontSizes(ScriptFontImportOptions* thisPtr);
+		static void internal_SetFontSizes(ScriptFontImportOptions* thisPtr, MonoArray* value);
+		static UINT32 internal_GetDPI(ScriptFontImportOptions* thisPtr);
+		static void internal_SetDPI(ScriptFontImportOptions* thisPtr, UINT32 value);
+		static FontRenderMode internal_GetRenderMode(ScriptFontImportOptions* thisPtr);
+		static void internal_SetRenderMode(ScriptFontImportOptions* thisPtr, FontRenderMode value);
+		static bool internal_GetBold(ScriptFontImportOptions* thisPtr);
+		static void internal_SetBold(ScriptFontImportOptions* thisPtr, bool value);
+		static bool internal_GetItalic(ScriptFontImportOptions* thisPtr);
+		static void internal_SetItalic(ScriptFontImportOptions* thisPtr, bool value);
+		static MonoArray* internal_GetCharRanges(ScriptFontImportOptions* thisPtr);
+		static void internal_SetCharRanges(ScriptFontImportOptions* thisPtr, MonoArray* value);
+	};
+
+	/**	Interop class between C++ & CLR for ScriptCodeImportOptions. */
+	class BS_SCR_BED_EXPORT ScriptScriptCodeImportOptions : public ScriptObject <ScriptScriptCodeImportOptions, ScriptImportOptionsBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ScriptCodeImportOptions")
+
+		/**
+		 * Creates a new managed ScriptCodeImportOptions instance containing the default import options for script code 
+		 * files.
+		 */
+		static MonoObject* create();
+
+		/** Creates a new managed ScriptCodeImportOptions instance containing the provided import options. */
+		static MonoObject* create(const SPtr<ScriptCodeImportOptions>& options);
+
+	private:
+		ScriptScriptCodeImportOptions(MonoObject* instance);
+
+		/**	Returns the internal native import options. */
+		SPtr<ScriptCodeImportOptions> getCodeImportOptions();
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance);
+		static bool internal_IsEditorScript(ScriptScriptCodeImportOptions* thisPtr);
+		static void internal_SetEditorScript(ScriptScriptCodeImportOptions* thisPtr, bool value);
+	};
+
+	/** @} */
 }

+ 53 - 53
Source/SBansheeEditor/Include/BsScriptInspectorUtility.h

@@ -1,54 +1,54 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR that deals with custom inspectors. Custom inspectors
-	 *			allow the developer to control exactly how certain types are displayed in the inspector
-	 *			window in the editor.
-	 */
-	class BS_SCR_BED_EXPORT ScriptInspectorUtility : public ScriptObject<ScriptInspectorUtility>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "InspectorUtility");
-
-		/**
-		 * @brief	Hooks up domain reload callback. Must be called on library load.
-		 */
-		static void startUp();
-
-		/**
-		 * @brief	Destroys domain reload callback. Must be called before library is unloaded.
-		 */
-		static void shutDown();
-
-
-	private:
-		ScriptInspectorUtility(MonoObject* instance);
-
-		/**
-		 * @brief	Reloads all assembly types and attempts to find uses of CustomInspector attribute. Old
-		 *			data cleared and replaced with new.
-		 */
-		static void reloadAssemblyData();
-
-		static MonoClass* mCustomInspectorAtribute;
-		static MonoField* mTypeField;
-
-		static UnorderedMap<MonoClass*, MonoClass*> mInspectorTypes;
-		static UnorderedMap<MonoClass*, MonoClass*> mInspectableFieldTypes;
-
-		static HEvent mDomainLoadedConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_GetCustomInspector(MonoReflectionType* reflType);
-		static MonoReflectionType* internal_GetCustomInspectable(MonoReflectionType* reflType);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**
+	 * Interop class between C++ & CLR that deals with custom inspectors. Custom inspectors	allow the developer to control
+	 * exactly how certain types are displayed in the inspector window in the editor.
+	 */
+	class BS_SCR_BED_EXPORT ScriptInspectorUtility : public ScriptObject<ScriptInspectorUtility>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "InspectorUtility");
+
+		/**	Hooks up domain reload callback. Must be called on library load. */
+		static void startUp();
+
+		/**	Destroys domain reload callback. Must be called before library is unloaded. */
+		static void shutDown();
+
+	private:
+		ScriptInspectorUtility(MonoObject* instance);
+
+		/**
+		 * Reloads all assembly types and attempts to find uses of CustomInspector attribute. Old data cleared and replaced
+		 * with new.
+		 */
+		static void reloadAssemblyData();
+
+		static MonoClass* mCustomInspectorAtribute;
+		static MonoField* mTypeField;
+
+		static UnorderedMap<MonoClass*, MonoClass*> mInspectorTypes;
+		static UnorderedMap<MonoClass*, MonoClass*> mInspectableFieldTypes;
+
+		static HEvent mDomainLoadedConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoObject* internal_GetCustomInspector(MonoReflectionType* reflType);
+		static MonoReflectionType* internal_GetCustomInspectable(MonoReflectionType* reflType);
+	};
+
+	/** @} */
 }

+ 145 - 158
Source/SBansheeEditor/Include/BsScriptModalWindow.h

@@ -1,159 +1,146 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsModalWindow.h"
-#include "BsVector2I.h"
-
-namespace BansheeEngine
-{
-	class ManagedModalWindow;
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ManagedModalWindow.
-	 */
-	class BS_SCR_BED_EXPORT ScriptModalWindow : public ScriptObject <ScriptModalWindow>
-	{
-		/**
-		 * @brief	Contains data about the managed handle to a modal window.
-		 */
-		struct ModalWindowHandle
-		{
-			uint32_t gcHandle;
-			ManagedModalWindow* nativeObj;
-		};
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ModalWindow")
-
-		~ScriptModalWindow();
-
-	private:
-		friend class ManagedModalWindow;
-
-		ScriptModalWindow(ManagedModalWindow* editorWidget);
-
-		/**
-		 * @brief	Triggered when assembly refresh has started.
-		 */
-		void onAssemblyRefreshStarted();
-
-		/**
-		 * @brief	Triggered when the native modal window is closed.
-		 */
-		void notifyWindowDestroyed();
-
-		ManagedModalWindow* mModalWindow;
-		HEvent mOnAssemblyRefreshStartedConn;
-
-		static MonoField* guiPanelField;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, bool allowCloseButton);
-		static void internal_close(ScriptModalWindow* thisPtr);
-		static UINT32 internal_getWidth(ScriptModalWindow* thisPtr);
-		static UINT32 internal_getHeight(ScriptModalWindow* thisPtr);
-		static void internal_setWidth(ScriptModalWindow* thisPtr, UINT32 value);
-		static void internal_setHeight(ScriptModalWindow* thisPtr, UINT32 value);
-		static void internal_setTitle(ScriptModalWindow* thisPtr, MonoObject* title);
-		static void internal_screenToWindowPos(ScriptModalWindow* thisPtr, Vector2I* screenPos, Vector2I* windowPos);
-		static void internal_windowToScreenPos(ScriptModalWindow* thisPtr, Vector2I* windowPos, Vector2I* screenPos);
-	};
-
-	/**
-	 * @brief	Modal window implementation that handles managed modal window implementations.
-	 *			Each implementation is wrapped in this object and then managed by its parent interop
-	 *			object of ScriptModalWindow type.
-	 */
-	class BS_SCR_BED_EXPORT ManagedModalWindow : public ModalWindow
-	{
-	public:
-		ManagedModalWindow(bool allowCloseButton, MonoObject* managedInstance);
-		~ManagedModalWindow();
-
-		/**
-		 * @brief	Attempts to create a managed instance for the modal window described by the
-		 *			type provided upon construction.
-		 *
-		 * @return	True if the managed instance was created.
-		 */
-		bool createManagedInstance();
-
-		/**
-		 * @brief	Releases the internally held handle to the managed instance. This will cause
-		 *			managed instance to be destroyed if no other references are being held.
-		 */
-		void releaseManagedInstance();
-
-		/**
-		 * @brief	Sets the parent interop object that handles part of the communication
-		 *			between this object and the managed instance.
-		 */
-		void setParent(ScriptModalWindow* parent);
-
-		/**
-		 * @copydoc	ModalWindow::update 
-		 */
-		void update() override;
-		
-		/**
-		 * @brief	Loads all required mono methods, fields and types required
-		 *			for operation of this object. Must be called after construction
-		 *			and after assembly refresh.
-		 *
-		 * @param	windowClass	Mono class to load the types from.
-		 */
-		void reloadMonoTypes(MonoClass* windowClass);
-
-		/**
-		 * @brief	Triggers OnInitialize callbacks on the managed instance.
-		 */
-		void triggerOnInitialize();
-
-		/**
-		 * @brief	Triggers OnDestroy callbacks on the managed instance.
-		 */
-		void triggerOnDestroy();
-
-		/**
-		 * @brief	Returns the managed instance for the modal window
-		 *			represented by this object.
-		 */
-		MonoObject* getManagedInstance() const { return mManagedInstance; }
-	protected:
-		/**
-		 * @copydoc	ModalWindow::resized
-		 */
-		virtual void resized() override;
-
-		/**
-		 * @copydoc	ModalWindow::close
-		 */
-		virtual void close() override;
-
-	private:
-		friend class ScriptModalWindow;
-
-		typedef void(__stdcall *OnInitializeThunkDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *OnDestroyThunkDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *UpdateThunkDef) (MonoObject*, MonoException**);
-
-		String mNamespace;
-		String mTypename;
-
-		OnInitializeThunkDef mOnInitializeThunk;
-		OnDestroyThunkDef mOnDestroyThunk;
-		UpdateThunkDef mUpdateThunk;
-		MonoMethod* mOnWindowResizedMethod;
-
-		bool mIsInitialized;
-		MonoObject* mManagedInstance;
-		uint32_t mGCHandle;
-
-		ScriptModalWindow* mScriptParent;
-		ScriptGUILayout* mContentsPanel;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsModalWindow.h"
+#include "BsVector2I.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	class ManagedModalWindow;
+
+	/**	Interop class between C++ & CLR for ManagedModalWindow. */
+	class BS_SCR_BED_EXPORT ScriptModalWindow : public ScriptObject <ScriptModalWindow>
+	{
+		/**	Contains data about the managed handle to a modal window. */
+		struct ModalWindowHandle
+		{
+			uint32_t gcHandle;
+			ManagedModalWindow* nativeObj;
+		};
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ModalWindow")
+
+		~ScriptModalWindow();
+
+	private:
+		friend class ManagedModalWindow;
+
+		ScriptModalWindow(ManagedModalWindow* editorWidget);
+
+		/**	Triggered when assembly refresh has started. */
+		void onAssemblyRefreshStarted();
+
+		/**	Triggered when the native modal window is closed. */
+		void notifyWindowDestroyed();
+
+		ManagedModalWindow* mModalWindow;
+		HEvent mOnAssemblyRefreshStartedConn;
+
+		static MonoField* guiPanelField;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, bool allowCloseButton);
+		static void internal_close(ScriptModalWindow* thisPtr);
+		static UINT32 internal_getWidth(ScriptModalWindow* thisPtr);
+		static UINT32 internal_getHeight(ScriptModalWindow* thisPtr);
+		static void internal_setWidth(ScriptModalWindow* thisPtr, UINT32 value);
+		static void internal_setHeight(ScriptModalWindow* thisPtr, UINT32 value);
+		static void internal_setTitle(ScriptModalWindow* thisPtr, MonoObject* title);
+		static void internal_screenToWindowPos(ScriptModalWindow* thisPtr, Vector2I* screenPos, Vector2I* windowPos);
+		static void internal_windowToScreenPos(ScriptModalWindow* thisPtr, Vector2I* windowPos, Vector2I* screenPos);
+	};
+
+	/** @} */
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/**
+	 * Modal window implementation that handles managed modal window implementations. Each implementation is wrapped in this
+	 * object and then managed by its parent interop object of ScriptModalWindow type.
+	 */
+	class BS_SCR_BED_EXPORT ManagedModalWindow : public ModalWindow
+	{
+	public:
+		ManagedModalWindow(bool allowCloseButton, MonoObject* managedInstance);
+		~ManagedModalWindow();
+
+		/**
+		 * Attempts to create a managed instance for the modal window described by the type provided upon construction.
+		 *
+		 * @return	True if the managed instance was created.
+		 */
+		bool createManagedInstance();
+
+		/**
+		 * Releases the internally held handle to the managed instance. This will cause managed instance to be destroyed if
+		 * no other references are being held.
+		 */
+		void releaseManagedInstance();
+
+		/**
+		 * Sets the parent interop object that handles part of the communication between this object and the managed
+		 * instance.
+		 */
+		void setParent(ScriptModalWindow* parent);
+
+		/** @copydoc ModalWindow::update */
+		void update() override;
+		
+		/**
+		 * Loads all required mono methods, fields and types required for operation of this object. Must be called after
+		 * construction and after assembly refresh.
+		 *
+		 * @param[in]	windowClass	Mono class to load the types from.
+		 */
+		void reloadMonoTypes(MonoClass* windowClass);
+
+		/**	Triggers OnInitialize callbacks on the managed instance. */
+		void triggerOnInitialize();
+
+		/**	Triggers OnDestroy callbacks on the managed instance. */
+		void triggerOnDestroy();
+
+		/**	Returns the managed instance for the modal window represented by this object. */
+		MonoObject* getManagedInstance() const { return mManagedInstance; }
+	protected:
+		/** @copydoc ModalWindow::resized */
+		virtual void resized() override;
+
+		/** @copydoc ModalWindow::close */
+		virtual void close() override;
+
+	private:
+		friend class ScriptModalWindow;
+
+		typedef void(__stdcall *OnInitializeThunkDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *OnDestroyThunkDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *UpdateThunkDef) (MonoObject*, MonoException**);
+
+		String mNamespace;
+		String mTypename;
+
+		OnInitializeThunkDef mOnInitializeThunk;
+		OnDestroyThunkDef mOnDestroyThunk;
+		UpdateThunkDef mUpdateThunk;
+		MonoMethod* mOnWindowResizedMethod;
+
+		bool mIsInitialized;
+		MonoObject* mManagedInstance;
+		uint32_t mGCHandle;
+
+		ScriptModalWindow* mScriptParent;
+		ScriptGUILayout* mContentsPanel;
+	};
+
+	/** @} */
 }

+ 137 - 146
Source/SBansheeEditor/Include/BsScriptOSDropTarget.h

@@ -1,147 +1,138 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsRect2I.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for OSDropTarget. Managed drop target
-	 *			is always associated with a managed EditorWindow.
-	 */
-	class BS_SCR_BED_EXPORT ScriptOSDropTarget : public ScriptObject <ScriptOSDropTarget>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "OSDropTarget")
-
-	private:
-		ScriptOSDropTarget(MonoObject* instance, ScriptEditorWindow* parent);
-		~ScriptOSDropTarget();
-
-		/**
-		 * @brief	Destroys the internal native drop target.
-		 */
-		void destroy();
-
-		/**
-		 * @brief	Creates an internal native drop target over the specified window. Any previous
-		 *			drop target is overwritten.
-		 * 
-		 * @param	parentWindow	Window the drop target is located on.
-		 * @param	x				X position of the drop target, relative to window, in pixels.
-		 * @param	y				Y position of the drop target, relative to window, in pixels.
-		 * @param	width			Width of the drop target in pixels.
-		 * @param	height			Height of the drop target in pixels.
-		 */
-		void setDropTarget(const RenderWindowPtr& parentWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
-
-		/**
-		 * @brief	Updates bounds of an existing drop target.
-		 *
-		 * @param	bounds	Area of the drop target relative to 
-		 *			the editor widget (EditorWindow in managed terms).
-		 */
-		void setBounds(const Rect2I& bounds);
-
-		/**
-		 * @brief	Triggered when editor widget (EditorWindow in managed terms) parent
-		 *			changes. This might mean we need to re-create the drop target
-		 *			as the parent render window might have changed.
-		 */
-		void widgetParentChanged(EditorWidgetContainer* parent);
-
-		/**
-		 * @brief	Triggered when the parent editor widget (EditorWindow in managed terms) is resized.
-		 */
-		void widgetResized(UINT32 width, UINT32 height);
-
-		/**
-		 * @brief	Triggered when the parent editor widget (EditorWindow in managed terms) is moved.
-		 */
-		void widgetMoved(INT32 x, INT32 y);
-
-		/**
-		 * @brief	Returns the editor widget (EditorWindow in managed terms) this drop target belongs to.
-		 */
-		EditorWidgetBase* getParentWidget() const;
-
-		/**
-		 * @brief	Returns the bounds of the drop target, relative to the parent window. This depends
-		 *			of set bounds using ::setBounds and the current position and size of the editor widget.
-		 */
-		Rect2I getDropTargetArea() const;
-
-		/**
-		 * @brief	Triggered when the drag and drop operation has entered the area over an OS drop target.
-		 *
-		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
-		 *						that triggered the event.
-		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
-		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
-		 */
-		static void dropTargetDragEnter(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
-
-		/**
-		 * @brief	Triggered every frame that pointer moves while over the area over an OS drop target.
-		 *
-		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
-		 *						that triggered the event.
-		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
-		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
-		 */
-		static void dropTargetDragMove(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
-
-		/**
-		 * @brief	Triggered when the drag and drop operation has left the area over an OS drop target.
-		 *
-		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
-		 *						that triggered the event.
-		 */
-		static void dropTargetDragLeave(ScriptOSDropTarget* thisPtr);
-
-		/**
-		 * @brief	Triggered when the drag and drop operation has finished over an OS drop target.
-		 *
-		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
-		 *						that triggered the event.
-		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
-		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
-		 */
-		static void dropTargetDragDropped(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
-
-		ScriptEditorWindow* mParent;
-		OSDropTarget* mDropTarget;
-		Rect2I mParentArea;
-		Rect2I mArea;
-		bool mIsDestroyed;
-
-		HEvent mDropTargetEnterConn;
-		HEvent mDropTargetMoveConn;
-		HEvent mDropTargetLeaveConn;
-		HEvent mDropTargetDroppedConn;
-		HEvent mWidgetParentChangedConn;
-		HEvent mWidgetMovedConn;
-		HEvent mWidgetResizedConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		typedef void(__stdcall *OnEnterThunkDef) (MonoObject*, INT32, INT32, MonoException**);
-		typedef void(__stdcall *OnMoveDef) (MonoObject*, INT32, INT32, MonoException**);
-		typedef void(__stdcall *OnLeaveDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *OnDropThunkDef) (MonoObject*, INT32, INT32, MonoException**);
-
-		static OnEnterThunkDef onEnterThunk;
-		static OnMoveDef onMoveThunk;
-		static OnLeaveDef onLeaveThunk;
-		static OnDropThunkDef onDropThunk;
-
-		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* editorWindow);
-		static void internal_Destroy(ScriptOSDropTarget* nativeInstance);
-		static void internal_SetBounds(ScriptOSDropTarget* nativeInstance, Rect2I* bounds);
-		static MonoArray* internal_GetFilePaths(ScriptOSDropTarget* nativeInstance);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsRect2I.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**
+	 * Interop class between C++ & CLR for OSDropTarget. Managed drop target is always associated with a managed
+	 * EditorWindow.
+	 */
+	class BS_SCR_BED_EXPORT ScriptOSDropTarget : public ScriptObject <ScriptOSDropTarget>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "OSDropTarget")
+
+	private:
+		ScriptOSDropTarget(MonoObject* instance, ScriptEditorWindow* parent);
+		~ScriptOSDropTarget();
+
+		/**	Destroys the internal native drop target. */
+		void destroy();
+
+		/**
+		 * Creates an internal native drop target over the specified window. Any previous drop target is overwritten.
+		 * 
+		 * @param[in]	parentWindow	Window the drop target is located on.
+		 * @param[in]	x				X position of the drop target, relative to window, in pixels.
+		 * @param[in]	y				Y position of the drop target, relative to window, in pixels.
+		 * @param[in]	width			Width of the drop target in pixels.
+		 * @param[in]	height			Height of the drop target in pixels.
+		 */
+		void setDropTarget(const RenderWindowPtr& parentWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
+
+		/**
+		 * Updates bounds of an existing drop target.
+		 *
+		 * @param[in]	bounds	Area of the drop target relative to the editor widget (EditorWindow in managed terms).
+		 */
+		void setBounds(const Rect2I& bounds);
+
+		/**
+		 * Triggered when editor widget (EditorWindow in managed terms) parent changes. This might mean we need to re-create
+		 * the drop target as the parent render window might have changed.
+		 */
+		void widgetParentChanged(EditorWidgetContainer* parent);
+
+		/**	Triggered when the parent editor widget (EditorWindow in managed terms) is resized. */
+		void widgetResized(UINT32 width, UINT32 height);
+
+		/**	Triggered when the parent editor widget (EditorWindow in managed terms) is moved. */
+		void widgetMoved(INT32 x, INT32 y);
+
+		/**	Returns the editor widget (EditorWindow in managed terms) this drop target belongs to. */
+		EditorWidgetBase* getParentWidget() const;
+
+		/**
+		 * Returns the bounds of the drop target, relative to the parent window. This depends of set bounds using 
+		 * setBounds() and the current position and size of the editor widget.
+		 */
+		Rect2I getDropTargetArea() const;
+
+		/**
+		 * Triggered when the drag and drop operation has entered the area over an OS drop target.
+		 *
+		 * @param[in]	thisPtr		C++/CLR interop object that contains the native OSDropTarget that triggered the event.
+		 * @param[in]	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param[in]	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
+		static void dropTargetDragEnter(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
+
+		/**
+		 * Triggered every frame that pointer moves while over the area over an OS drop target.
+		 *
+		 * @param[in]	thisPtr		C++/CLR interop object that contains the native OSDropTarget that triggered the event.
+		 * @param[in]	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param[in]	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
+		static void dropTargetDragMove(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
+
+		/**
+		 * Triggered when the drag and drop operation has left the area over an OS drop target.
+		 *
+		 * @param[in]	thisPtr		C++/CLR interop object that contains the native OSDropTarget that triggered the event.
+		 */
+		static void dropTargetDragLeave(ScriptOSDropTarget* thisPtr);
+
+		/**
+		 * Triggered when the drag and drop operation has finished over an OS drop target.
+		 *
+		 * @param[in]	thisPtr		C++/CLR interop object that contains the native OSDropTarget that triggered the event.
+		 * @param[in]	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param[in]	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
+		static void dropTargetDragDropped(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
+
+		ScriptEditorWindow* mParent;
+		OSDropTarget* mDropTarget;
+		Rect2I mParentArea;
+		Rect2I mArea;
+		bool mIsDestroyed;
+
+		HEvent mDropTargetEnterConn;
+		HEvent mDropTargetMoveConn;
+		HEvent mDropTargetLeaveConn;
+		HEvent mDropTargetDroppedConn;
+		HEvent mWidgetParentChangedConn;
+		HEvent mWidgetMovedConn;
+		HEvent mWidgetResizedConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		typedef void(__stdcall *OnEnterThunkDef) (MonoObject*, INT32, INT32, MonoException**);
+		typedef void(__stdcall *OnMoveDef) (MonoObject*, INT32, INT32, MonoException**);
+		typedef void(__stdcall *OnLeaveDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *OnDropThunkDef) (MonoObject*, INT32, INT32, MonoException**);
+
+		static OnEnterThunkDef onEnterThunk;
+		static OnMoveDef onMoveThunk;
+		static OnLeaveDef onLeaveThunk;
+		static OnDropThunkDef onDropThunk;
+
+		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* editorWindow);
+		static void internal_Destroy(ScriptOSDropTarget* nativeInstance);
+		static void internal_SetBounds(ScriptOSDropTarget* nativeInstance, Rect2I* bounds);
+		static MonoArray* internal_GetFilePaths(ScriptOSDropTarget* nativeInstance);
+	};
+
+	/** @} */
 }

+ 80 - 91
Source/SBansheeEditor/Include/BsScriptPlatformInfo.h

@@ -1,92 +1,81 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsPlatformInfo.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Base class for all C++/CLR interop objects dealing with specific
-	 *			PlatformInfo implementations.
-	 */
-	class BS_SCR_BED_EXPORT ScriptPlatformInfoBase : public ScriptObjectBase
-	{
-	public:
-		/**
-		 * @brief	Returns the internal native platform info object.
-		 */
-		SPtr<PlatformInfo> getPlatformInfo() const { return mPlatformInfo; }
-
-	protected:
-		ScriptPlatformInfoBase(MonoObject* instance);
-		virtual ~ScriptPlatformInfoBase() {}
-
-		SPtr<PlatformInfo> mPlatformInfo;
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for PlatformInfo.
-	 */
-	class BS_SCR_BED_EXPORT ScriptPlatformInfo : public ScriptObject <ScriptPlatformInfo, ScriptPlatformInfoBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "PlatformInfo")
-
-		/**
-		 * @brief	Creates a new managed platform info object that wraps the provided
-		 *			native platform info.
-		 */
-		static MonoObject* create(const SPtr<PlatformInfo>& platformInfo);
-	private:
-		ScriptPlatformInfo(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static PlatformType internal_GetType(ScriptPlatformInfoBase* thisPtr);
-		static MonoString* internal_GetDefines(ScriptPlatformInfoBase* thisPtr);
-		static void internal_SetDefines(ScriptPlatformInfoBase* thisPtr, MonoString* value);
-		static MonoObject* internal_GetMainScene(ScriptPlatformInfoBase* thisPtr);
-		static void internal_SetMainScene(ScriptPlatformInfoBase* thisPtr, ScriptResourceRef* prefabRef);
-		static bool internal_GetFullscreen(ScriptPlatformInfoBase* thisPtr);
-		static void internal_SetFullscreen(ScriptPlatformInfoBase* thisPtr, bool fullscreen);
-		static void internal_GetResolution(ScriptPlatformInfoBase* thisPtr, UINT32* width, UINT32* height);
-		static void internal_SetResolution(ScriptPlatformInfoBase* thisPtr, UINT32 width, UINT32 height);
-		static bool internal_GetDebug(ScriptPlatformInfoBase* thisPtr);
-		static void internal_SetDebug(ScriptPlatformInfoBase* thisPtr, bool debug);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for WinPlatformInfo.
-	 */
-	class BS_SCR_BED_EXPORT ScriptWinPlatformInfo : public ScriptObject <ScriptWinPlatformInfo, ScriptPlatformInfoBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "WinPlatformInfo")
-
-		/**
-		 * @brief	Creates a new managed platform info object that wraps the provided
-		 *			native platform info.
-		 */
-		static MonoObject* create(const SPtr<WinPlatformInfo>& platformInfo);
-
-	private:
-		ScriptWinPlatformInfo(MonoObject* instance);
-
-		/**
-		 * @brief	Returns the internal native Windows platform info object.
-		 */
-		SPtr<WinPlatformInfo> getWinPlatformInfo() const;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_GetIcon(ScriptWinPlatformInfo* thisPtr);
-		static void internal_SetIcon(ScriptWinPlatformInfo* thisPtr, ScriptResourceRef* textureRef);
-		static MonoString* internal_GetTitleText(ScriptWinPlatformInfo* thisPtr);
-		static void internal_SetTitleText(ScriptWinPlatformInfo* thisPtr, MonoString* text);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsPlatformInfo.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/** Base class for all C++/CLR interop objects dealing with specific PlatformInfo implementations. */
+	class BS_SCR_BED_EXPORT ScriptPlatformInfoBase : public ScriptObjectBase
+	{
+	public:
+		/**	Returns the internal native platform info object. */
+		SPtr<PlatformInfo> getPlatformInfo() const { return mPlatformInfo; }
+
+	protected:
+		ScriptPlatformInfoBase(MonoObject* instance);
+		virtual ~ScriptPlatformInfoBase() {}
+
+		SPtr<PlatformInfo> mPlatformInfo;
+	};
+
+	/**	Interop class between C++ & CLR for PlatformInfo. */
+	class BS_SCR_BED_EXPORT ScriptPlatformInfo : public ScriptObject <ScriptPlatformInfo, ScriptPlatformInfoBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "PlatformInfo")
+
+		/** Creates a new managed platform info object that wraps the provided native platform info. */
+		static MonoObject* create(const SPtr<PlatformInfo>& platformInfo);
+	private:
+		ScriptPlatformInfo(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static PlatformType internal_GetType(ScriptPlatformInfoBase* thisPtr);
+		static MonoString* internal_GetDefines(ScriptPlatformInfoBase* thisPtr);
+		static void internal_SetDefines(ScriptPlatformInfoBase* thisPtr, MonoString* value);
+		static MonoObject* internal_GetMainScene(ScriptPlatformInfoBase* thisPtr);
+		static void internal_SetMainScene(ScriptPlatformInfoBase* thisPtr, ScriptResourceRef* prefabRef);
+		static bool internal_GetFullscreen(ScriptPlatformInfoBase* thisPtr);
+		static void internal_SetFullscreen(ScriptPlatformInfoBase* thisPtr, bool fullscreen);
+		static void internal_GetResolution(ScriptPlatformInfoBase* thisPtr, UINT32* width, UINT32* height);
+		static void internal_SetResolution(ScriptPlatformInfoBase* thisPtr, UINT32 width, UINT32 height);
+		static bool internal_GetDebug(ScriptPlatformInfoBase* thisPtr);
+		static void internal_SetDebug(ScriptPlatformInfoBase* thisPtr, bool debug);
+	};
+
+	/**	Interop class between C++ & CLR for WinPlatformInfo. */
+	class BS_SCR_BED_EXPORT ScriptWinPlatformInfo : public ScriptObject <ScriptWinPlatformInfo, ScriptPlatformInfoBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "WinPlatformInfo")
+
+		/**	Creates a new managed platform info object that wraps the provided native platform info. */
+		static MonoObject* create(const SPtr<WinPlatformInfo>& platformInfo);
+
+	private:
+		ScriptWinPlatformInfo(MonoObject* instance);
+
+		/**	Returns the internal native Windows platform info object. */
+		SPtr<WinPlatformInfo> getWinPlatformInfo() const;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoObject* internal_GetIcon(ScriptWinPlatformInfo* thisPtr);
+		static void internal_SetIcon(ScriptWinPlatformInfo* thisPtr, ScriptResourceRef* textureRef);
+		static MonoString* internal_GetTitleText(ScriptWinPlatformInfo* thisPtr);
+		static void internal_SetTitleText(ScriptWinPlatformInfo* thisPtr, MonoString* text);
+	};
+
+	/** @} */
 }

+ 33 - 29
Source/SBansheeEditor/Include/BsScriptPrefabUtility.h

@@ -1,30 +1,34 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for PrefabUtility.
-	 */
-	class BS_SCR_BED_EXPORT ScriptPrefabUtility : public ScriptObject <ScriptPrefabUtility>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "PrefabUtility")
-
-	private:
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_breakPrefab(ScriptSceneObject* nativeInstance);
-		static void internal_applyPrefab(ScriptSceneObject* nativeInstance);
-		static void internal_revertPrefab(ScriptSceneObject* nativeInstance);
-		static bool internal_hasPrefabLink(ScriptSceneObject* nativeInstance);
-		static MonoObject* internal_getPrefabParent(ScriptSceneObject* nativeInstance);
-
-		ScriptPrefabUtility(MonoObject* instance);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for PrefabUtility. */
+	class BS_SCR_BED_EXPORT ScriptPrefabUtility : public ScriptObject <ScriptPrefabUtility>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "PrefabUtility")
+
+	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_breakPrefab(ScriptSceneObject* nativeInstance);
+		static void internal_applyPrefab(ScriptSceneObject* nativeInstance);
+		static void internal_revertPrefab(ScriptSceneObject* nativeInstance);
+		static bool internal_hasPrefabLink(ScriptSceneObject* nativeInstance);
+		static MonoObject* internal_getPrefabParent(ScriptSceneObject* nativeInstance);
+
+		ScriptPrefabUtility(MonoObject* instance);
+	};
+
+	/** @} */
 }

+ 177 - 189
Source/SBansheeEditor/Include/BsScriptProjectLibrary.h

@@ -1,190 +1,178 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsProjectLibrary.h"
-#include "BsScriptResource.h"
-
-namespace BansheeEngine
-{
-	/**	Interop class between C++ & CLR for ProjectLibrary. */
-	class BS_SCR_BED_EXPORT ScriptProjectLibrary : public ScriptObject<ScriptProjectLibrary>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ProjectLibrary")
-
-		/**	Initializes the project library callbacks. Must be called on library load. */
-		void static startUp();
-
-		/**	Cleans up project library callbacks. Must be called before library shutdown. */
-		void static shutDown();
-
-	private:
-		ScriptProjectLibrary(MonoObject* instance);
-
-		/**
-		 * Triggered when a new entry has been added to the library.
-		 *
-		 * @param[in]	path	Absolute path to the new entry.
-		 */
-		static void onEntryAdded(const Path& path);
-
-		/**
-		 * Triggered when a new entry has been removed to the library.
-		 *
-		 * @param[in]	path	Absolute path to the removed entry.
-		 */
-		static void onEntryRemoved(const Path& path);
-
-		/**
-		 * Triggered when an entry was (re) imported in the library.
-		 *
-		 * @param[in]	path	Absolute path to the imported entry.
-		 */
-		static void onEntryImported(const Path& path);
-
-		static HEvent mOnEntryAddedConn;
-		static HEvent mOnEntryRemovedConn;
-		static HEvent mOnEntryImportedConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		typedef void(__stdcall *OnEntryChangedThunkDef) (MonoString*, MonoException**);
-
-		static OnEntryChangedThunkDef OnEntryAddedThunk;
-		static OnEntryChangedThunkDef OnEntryRemovedThunk;
-		static OnEntryChangedThunkDef OnEntryImportedThunk;
-
-		static MonoArray* internal_Refresh(MonoString* path, bool import);
-		static void internal_Create(MonoObject* resource, MonoString* path);
-		static MonoObject* internal_Load(MonoString* path);
-		static void internal_Save(MonoObject* resource);
-		static MonoObject* internal_GetRoot();
-		static void internal_Reimport(MonoString* path, MonoObject* options, bool force);
-		static MonoObject* internal_GetEntry(MonoString* path);
-		static bool internal_IsSubresource(MonoString* path);
-		static MonoObject* internal_GetMeta(MonoString* path);
-		static MonoString* internal_GetPathFromUUID(MonoString* uuid);
-		static MonoString* internal_GetPath(MonoObject* resource);
-		static MonoArray* internal_Search(MonoString* pattern, MonoArray* types);
-		static void internal_Delete(MonoString* path);
-		static void internal_CreateFolder(MonoString* path);
-		static void internal_Rename(MonoString* path, MonoString* name, bool overwrite);
-		static void internal_Move(MonoString* oldPath, MonoString* newPath, bool overwrite);
-		static void internal_Copy(MonoString* source, MonoString* destination, bool overwrite);
-		static MonoString* internal_GetResourceFolder();
-		static void internal_SetIncludeInBuild(MonoString* path, bool include);
-	};
-
-	/**	Base class for C++/CLR interop objects used for wrapping LibraryEntry implementations. */
-	class BS_SCR_BED_EXPORT ScriptLibraryEntryBase : public ScriptObjectBase
-	{
-	public:
-		/**
-		 * @brief	Returns the asset path of the library entry.
-		 */
-		const Path& getAssetPath() const { return mAssetPath; }
-
-	protected:
-		ScriptLibraryEntryBase(MonoObject* instance);
-		virtual ~ScriptLibraryEntryBase() {}
-
-		Path mAssetPath;
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for LibraryEntry.
-	 */
-	class BS_SCR_BED_EXPORT ScriptLibraryEntry : public ScriptObject <ScriptLibraryEntry>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "LibraryEntry")
-
-	private:
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoString* internal_GetPath(ScriptLibraryEntryBase* thisPtr);
-		static MonoString* internal_GetName(ScriptLibraryEntryBase* thisPtr);
-		static ProjectLibrary::LibraryEntryType internal_GetType(ScriptLibraryEntryBase* thisPtr);
-		static MonoObject* internal_GetParent(ScriptLibraryEntryBase* thisPtr);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for DirectoryEntry.
-	 */
-	class BS_SCR_BED_EXPORT ScriptDirectoryEntry : public ScriptObject <ScriptDirectoryEntry, ScriptLibraryEntryBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DirectoryEntry")
-
-		ScriptDirectoryEntry(MonoObject* instance, const Path& assetPath);
-
-		/**
-		 * @brief	Creates a new interop object that wraps the provided
-		 *			native directory entry object.
-		 */
-		static MonoObject* create(const ProjectLibrary::DirectoryEntry* entry);
-
-	private:
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoArray* internal_GetChildren(ScriptDirectoryEntry* thisPtr);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ResourceEntry.
-	 */
-	class BS_SCR_BED_EXPORT ScriptFileEntry : public ScriptObject <ScriptFileEntry, ScriptLibraryEntryBase>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FileEntry")
-
-		ScriptFileEntry(MonoObject* instance, const Path& assetPath);
-
-		/**
-		 * @brief	Creates a new interop object that wraps the provided
-		 *			native resource entry object.
-		 */
-		static MonoObject* create(const ProjectLibrary::FileEntry* entry);
-
-	private:
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_GetImportOptions(ScriptFileEntry* thisPtr);
-		static MonoArray* internal_GetResourceMetas(ScriptFileEntry* thisPtr);
-		static bool internal_GetIncludeInBuild(ScriptFileEntry* thisPtr);
-	};
-
-	/**
-	 * @brief	Interop class between C++ & CLR for ResourceMeta.
-	 */
-	class BS_SCR_BED_EXPORT ScriptResourceMeta : public ScriptObject <ScriptResourceMeta>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ResourceMeta")
-
-		ScriptResourceMeta(MonoObject* instance, const ProjectResourceMetaPtr& meta);
-
-		/**
-		 * Creates a new interop object that wraps the native resource meta object.
-		 */
-		static MonoObject* create(const ProjectResourceMetaPtr& meta);
-
-	private:
-		ProjectResourceMetaPtr mMeta;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoString* internal_GetUUID(ScriptResourceMeta* thisPtr);
-		static MonoString* internal_GetSubresourceName(ScriptResourceMeta* thisPtr);
-		static MonoObject* internal_GetIcon(ScriptResourceMeta* thisPtr);
-		static ScriptResourceType internal_GetResourceType(ScriptResourceMeta* thisPtr);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsProjectLibrary.h"
+#include "BsScriptResource.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for ProjectLibrary. */
+	class BS_SCR_BED_EXPORT ScriptProjectLibrary : public ScriptObject<ScriptProjectLibrary>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ProjectLibrary")
+
+		/**	Initializes the project library callbacks. Must be called on library load. */
+		void static startUp();
+
+		/**	Cleans up project library callbacks. Must be called before library shutdown. */
+		void static shutDown();
+
+	private:
+		ScriptProjectLibrary(MonoObject* instance);
+
+		/**
+		 * Triggered when a new entry has been added to the library.
+		 *
+		 * @param[in]	path	Absolute path to the new entry.
+		 */
+		static void onEntryAdded(const Path& path);
+
+		/**
+		 * Triggered when a new entry has been removed to the library.
+		 *
+		 * @param[in]	path	Absolute path to the removed entry.
+		 */
+		static void onEntryRemoved(const Path& path);
+
+		/**
+		 * Triggered when an entry was (re) imported in the library.
+		 *
+		 * @param[in]	path	Absolute path to the imported entry.
+		 */
+		static void onEntryImported(const Path& path);
+
+		static HEvent mOnEntryAddedConn;
+		static HEvent mOnEntryRemovedConn;
+		static HEvent mOnEntryImportedConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		typedef void(__stdcall *OnEntryChangedThunkDef) (MonoString*, MonoException**);
+
+		static OnEntryChangedThunkDef OnEntryAddedThunk;
+		static OnEntryChangedThunkDef OnEntryRemovedThunk;
+		static OnEntryChangedThunkDef OnEntryImportedThunk;
+
+		static MonoArray* internal_Refresh(MonoString* path, bool import);
+		static void internal_Create(MonoObject* resource, MonoString* path);
+		static MonoObject* internal_Load(MonoString* path);
+		static void internal_Save(MonoObject* resource);
+		static MonoObject* internal_GetRoot();
+		static void internal_Reimport(MonoString* path, MonoObject* options, bool force);
+		static MonoObject* internal_GetEntry(MonoString* path);
+		static bool internal_IsSubresource(MonoString* path);
+		static MonoObject* internal_GetMeta(MonoString* path);
+		static MonoString* internal_GetPathFromUUID(MonoString* uuid);
+		static MonoString* internal_GetPath(MonoObject* resource);
+		static MonoArray* internal_Search(MonoString* pattern, MonoArray* types);
+		static void internal_Delete(MonoString* path);
+		static void internal_CreateFolder(MonoString* path);
+		static void internal_Rename(MonoString* path, MonoString* name, bool overwrite);
+		static void internal_Move(MonoString* oldPath, MonoString* newPath, bool overwrite);
+		static void internal_Copy(MonoString* source, MonoString* destination, bool overwrite);
+		static MonoString* internal_GetResourceFolder();
+		static void internal_SetIncludeInBuild(MonoString* path, bool include);
+	};
+
+	/**	Base class for C++/CLR interop objects used for wrapping LibraryEntry implementations. */
+	class BS_SCR_BED_EXPORT ScriptLibraryEntryBase : public ScriptObjectBase
+	{
+	public:
+		/**	Returns the asset path of the library entry. */
+		const Path& getAssetPath() const { return mAssetPath; }
+
+	protected:
+		ScriptLibraryEntryBase(MonoObject* instance);
+		virtual ~ScriptLibraryEntryBase() {}
+
+		Path mAssetPath;
+	};
+
+	/**	Interop class between C++ & CLR for LibraryEntry. */
+	class BS_SCR_BED_EXPORT ScriptLibraryEntry : public ScriptObject <ScriptLibraryEntry>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "LibraryEntry")
+
+	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoString* internal_GetPath(ScriptLibraryEntryBase* thisPtr);
+		static MonoString* internal_GetName(ScriptLibraryEntryBase* thisPtr);
+		static ProjectLibrary::LibraryEntryType internal_GetType(ScriptLibraryEntryBase* thisPtr);
+		static MonoObject* internal_GetParent(ScriptLibraryEntryBase* thisPtr);
+	};
+
+	/**	Interop class between C++ & CLR for DirectoryEntry. */
+	class BS_SCR_BED_EXPORT ScriptDirectoryEntry : public ScriptObject <ScriptDirectoryEntry, ScriptLibraryEntryBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "DirectoryEntry")
+
+		ScriptDirectoryEntry(MonoObject* instance, const Path& assetPath);
+
+		/** Creates a new interop object that wraps the provided native directory entry object. */
+		static MonoObject* create(const ProjectLibrary::DirectoryEntry* entry);
+
+	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoArray* internal_GetChildren(ScriptDirectoryEntry* thisPtr);
+	};
+
+	/**	Interop class between C++ & CLR for ResourceEntry. */
+	class BS_SCR_BED_EXPORT ScriptFileEntry : public ScriptObject <ScriptFileEntry, ScriptLibraryEntryBase>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FileEntry")
+
+		ScriptFileEntry(MonoObject* instance, const Path& assetPath);
+
+		/** Creates a new interop object that wraps the provided native resource entry object. */
+		static MonoObject* create(const ProjectLibrary::FileEntry* entry);
+
+	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoObject* internal_GetImportOptions(ScriptFileEntry* thisPtr);
+		static MonoArray* internal_GetResourceMetas(ScriptFileEntry* thisPtr);
+		static bool internal_GetIncludeInBuild(ScriptFileEntry* thisPtr);
+	};
+
+	/**	Interop class between C++ & CLR for ResourceMeta. */
+	class BS_SCR_BED_EXPORT ScriptResourceMeta : public ScriptObject <ScriptResourceMeta>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ResourceMeta")
+
+		ScriptResourceMeta(MonoObject* instance, const ProjectResourceMetaPtr& meta);
+
+		/** Creates a new interop object that wraps the native resource meta object. */
+		static MonoObject* create(const ProjectResourceMetaPtr& meta);
+
+	private:
+		ProjectResourceMetaPtr mMeta;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoString* internal_GetUUID(ScriptResourceMeta* thisPtr);
+		static MonoString* internal_GetSubresourceName(ScriptResourceMeta* thisPtr);
+		static MonoObject* internal_GetIcon(ScriptResourceMeta* thisPtr);
+		static ScriptResourceType internal_GetResourceType(ScriptResourceMeta* thisPtr);
+	};
+
+	/** @} */
 }

+ 47 - 43
Source/SBansheeEditor/Include/BsScriptProjectSettings.h

@@ -1,44 +1,48 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for ProjectSettings stored in EditorApplication.
-	 */
-	class BS_SCR_BED_EXPORT ScriptProjectSettings : public ScriptObject <ScriptProjectSettings>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ProjectSettings")
-
-	private:
-		ScriptProjectSettings(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoString* internal_GetLastOpenScene();
-		static void internal_SetLastOpenScene(MonoString* value);
-
-		static void internal_SetFloat(MonoString* name, float value);
-		static void internal_SetInt(MonoString* name, int value);
-		static void internal_SetBool(MonoString* name, bool value);
-		static void internal_SetString(MonoString* name, MonoString* value);
-
-		static float internal_GetFloat(MonoString* name, float defaultValue);
-		static int internal_GetInt(MonoString* name, int defaultValue);
-		static bool internal_GetBool(MonoString* name, bool defaultValue);
-		static MonoString* internal_GetString(MonoString* name, MonoString* defaultValue);
-
-		static bool internal_HasKey(MonoString* name);
-		static void internal_DeleteKey(MonoString* name);
-		static void internal_DeleteAllKeys();
-
-		static UINT32 internal_GetHash();
-		static void internal_Save();
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for ProjectSettings stored in EditorApplication. */
+	class BS_SCR_BED_EXPORT ScriptProjectSettings : public ScriptObject <ScriptProjectSettings>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ProjectSettings")
+
+	private:
+		ScriptProjectSettings(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoString* internal_GetLastOpenScene();
+		static void internal_SetLastOpenScene(MonoString* value);
+
+		static void internal_SetFloat(MonoString* name, float value);
+		static void internal_SetInt(MonoString* name, int value);
+		static void internal_SetBool(MonoString* name, bool value);
+		static void internal_SetString(MonoString* name, MonoString* value);
+
+		static float internal_GetFloat(MonoString* name, float defaultValue);
+		static int internal_GetInt(MonoString* name, int defaultValue);
+		static bool internal_GetBool(MonoString* name, bool defaultValue);
+		static MonoString* internal_GetString(MonoString* name, MonoString* defaultValue);
+
+		static bool internal_HasKey(MonoString* name);
+		static void internal_DeleteKey(MonoString* name);
+		static void internal_DeleteAllKeys();
+
+		static UINT32 internal_GetHash();
+		static void internal_Save();
+	};
+
+	/** @} */
 }

+ 33 - 27
Source/SBansheeEditor/Include/BsScriptSceneGizmos.h

@@ -1,28 +1,34 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/** Interop class between C++ & CLR for SceneGizmos. */
-	class BS_SCR_BED_EXPORT ScriptSceneGizmos : public ScriptObject <ScriptSceneGizmos>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneGizmos")
-
-	private:
-		ScriptSceneGizmos(MonoObject* object, const SPtr<Camera>& camera);
-		~ScriptSceneGizmos();
-
-		SPtr<Camera> mCamera;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
-		static void internal_Draw(ScriptSceneGizmos* thisPtr);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/** Interop class between C++ & CLR for SceneGizmos. */
+	class BS_SCR_BED_EXPORT ScriptSceneGizmos : public ScriptObject <ScriptSceneGizmos>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneGizmos")
+
+	private:
+		ScriptSceneGizmos(MonoObject* object, const SPtr<Camera>& camera);
+		~ScriptSceneGizmos();
+
+		SPtr<Camera> mCamera;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
+		static void internal_Draw(ScriptSceneGizmos* thisPtr);
+	};
+
+	/** @} */
 }

+ 34 - 28
Source/SBansheeEditor/Include/BsScriptSceneGrid.h

@@ -1,29 +1,35 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/** Interop class between C++ & CLR for SceneGrid. */
-	class BS_SCR_BED_EXPORT ScriptSceneGrid : public ScriptObject <ScriptSceneGrid>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneGrid")
-
-	private:
-		ScriptSceneGrid(MonoObject* object, const SPtr<Camera>& camera);
-		~ScriptSceneGrid();
-
-		SceneGrid* mSceneGrid;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
-		static void internal_Draw(ScriptSceneGrid* thisPtr);
-		static void internal_SetMode(ScriptSceneGrid* thisPtr, UINT32 mode);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/** Interop class between C++ & CLR for SceneGrid. */
+	class BS_SCR_BED_EXPORT ScriptSceneGrid : public ScriptObject <ScriptSceneGrid>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneGrid")
+
+	private:
+		ScriptSceneGrid(MonoObject* object, const SPtr<Camera>& camera);
+		~ScriptSceneGrid();
+
+		SceneGrid* mSceneGrid;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
+		static void internal_Draw(ScriptSceneGrid* thisPtr);
+		static void internal_SetMode(ScriptSceneGrid* thisPtr, UINT32 mode);
+	};
+
+	/** @} */
 }

+ 51 - 45
Source/SBansheeEditor/Include/BsScriptSceneHandles.h

@@ -1,46 +1,52 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-#include "BsVector2I.h"
-
-namespace BansheeEngine
-{
-	/** Interop class between C++ & CLR for SceneHandles. */
-	class BS_SCR_BED_EXPORT ScriptSceneHandles : public ScriptObject <ScriptSceneHandles>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneHandles")
-
-	private:
-		ScriptSceneHandles(MonoObject* object, EditorWidgetBase* parentWidget, const SPtr<Camera>& camera);
-		~ScriptSceneHandles();
-
-		/**
-		 * @brief	Checks is the pointer currently within the provided window, and if it is not
-		 *			the cursor is wrapped in such a way so that it is returned to within the window bounds.
-		 *		
-		 * @return	How far was the cursor moved due to wrapping. This will be (0, 0) if the cursor is within
-		 *			window bounds initially.
-		 */
-		Vector2I wrapCursorToWindow() const;
-
-		EditorWidgetBase* mParentWidget;
-		SPtr<Camera> mCamera;
-		Vector2I mMouseDeltaCompensate;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Create(MonoObject* managedInstance, ScriptEditorWindow* parentWindow, ScriptCamera* camera);
-		static void internal_Draw(ScriptSceneHandles* thisPtr);
-		static void internal_BeginInput();
-		static void internal_EndInput();
-		static void internal_UpdateInput(ScriptSceneHandles* thisPtr, Vector2I* inputPos, Vector2I* inputDelta);
-		static void internal_TrySelect(ScriptSceneHandles* thisPtr, Vector2I* inputPos);
-		static bool internal_IsActive(ScriptSceneHandles* thisPtr);
-		static void internal_ClearSelection(ScriptSceneHandles* thisPtr);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsVector2I.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/** Interop class between C++ & CLR for SceneHandles. */
+	class BS_SCR_BED_EXPORT ScriptSceneHandles : public ScriptObject <ScriptSceneHandles>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneHandles")
+
+	private:
+		ScriptSceneHandles(MonoObject* object, EditorWidgetBase* parentWidget, const SPtr<Camera>& camera);
+		~ScriptSceneHandles();
+
+		/**
+		 * Checks is the pointer currently within the provided window, and if it is not the cursor is wrapped in such a way
+		 * so that it is returned to within the window bounds.
+		 *		
+		 * @return	How far was the cursor moved due to wrapping. This will be (0, 0) if the cursor is within window bounds
+		 *			initially.
+		 */
+		Vector2I wrapCursorToWindow() const;
+
+		EditorWidgetBase* mParentWidget;
+		SPtr<Camera> mCamera;
+		Vector2I mMouseDeltaCompensate;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Create(MonoObject* managedInstance, ScriptEditorWindow* parentWindow, ScriptCamera* camera);
+		static void internal_Draw(ScriptSceneHandles* thisPtr);
+		static void internal_BeginInput();
+		static void internal_EndInput();
+		static void internal_UpdateInput(ScriptSceneHandles* thisPtr, Vector2I* inputPos, Vector2I* inputDelta);
+		static void internal_TrySelect(ScriptSceneHandles* thisPtr, Vector2I* inputPos);
+		static bool internal_IsActive(ScriptSceneHandles* thisPtr);
+		static void internal_ClearSelection(ScriptSceneHandles* thisPtr);
+	};
+
+	/** @} */
 }

+ 35 - 29
Source/SBansheeEditor/Include/BsScriptSceneSelection.h

@@ -1,30 +1,36 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/** Interop class between C++ & CLR for SceneSelection. */
-	class BS_SCR_BED_EXPORT ScriptSceneSelection : public ScriptObject <ScriptSceneSelection>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneSelection")
-
-	private:
-		ScriptSceneSelection(MonoObject* object, const SPtr<Camera>& camera);
-		~ScriptSceneSelection();
-
-		SPtr<Camera> mCamera;
-		SelectionRenderer* mSelectionRenderer;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
-		static void internal_Draw(ScriptSceneSelection* thisPtr);
-		static void internal_PickObject(ScriptSceneSelection* thisPtr, Vector2I* inputPos, bool additive);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/** Interop class between C++ & CLR for SceneSelection. */
+	class BS_SCR_BED_EXPORT ScriptSceneSelection : public ScriptObject <ScriptSceneSelection>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneSelection")
+
+	private:
+		ScriptSceneSelection(MonoObject* object, const SPtr<Camera>& camera);
+		~ScriptSceneSelection();
+
+		SPtr<Camera> mCamera;
+		SelectionRenderer* mSelectionRenderer;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Create(MonoObject* managedInstance, ScriptCamera* camera);
+		static void internal_Draw(ScriptSceneSelection* thisPtr);
+		static void internal_PickObject(ScriptSceneSelection* thisPtr, Vector2I* inputPos, bool additive);
+	};
+
+	/** @} */
 }

+ 73 - 77
Source/SBansheeEditor/Include/BsScriptSelection.h

@@ -1,78 +1,74 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for Selection.
-	 */
-	class BS_SCR_BED_EXPORT ScriptSelection : public ScriptObject<ScriptSelection>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Selection");
-
-		/**
-		 * @brief	Hooks up selection callbacks. Must be called on library load.
-		 */
-		static void startUp();
-
-		/**
-		 * @brief	Destroys selection callbacks. Must be called before library is unloaded.
-		 */
-		static void shutDown();
-
-	private:
-		ScriptSelection(MonoObject* instance);
-
-		/**
-		 * @brief	Triggered when selection has changed.
-		 *
-		 * @param	sceneObject	Newly selected scene objects. This will be empty if no scene objects are
-		 *						selected or if selection hasn't changed.
-		 * @param	resPaths	Paths to newly selected resources. This will be empty if no resources are
-		 *						selected or if selection hasn't changed.
-		 */
-		static void onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths);
-
-		/**
-		 * @brief	Triggered when ping action is requested for the resource at the specified path.
-		 */
-		static void onResourcePing(const Path& resPath);
-
-		/**
-		 * @brief	Triggered when ping action is requested for the specified scene object.
-		 */
-		static void onSceneObjectPing(const HSceneObject& sceneObject);
-
-		static HEvent OnSelectionChangedConn;
-		static HEvent OnPingResourceConn;
-		static HEvent OnPingSceneObjectConn;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoArray*, MonoArray*, MonoException**);
-		typedef void(__stdcall *OnPingResourceThunkDef) (MonoString*, MonoException**);
-		typedef void(__stdcall *OnPingSceneObjectThunkDef) (MonoObject*, MonoException**);
-
-		static OnSelectionChangedThunkDef OnSelectionChangedThunk;
-		static OnPingResourceThunkDef OnPingResourceThunk;
-		static OnPingSceneObjectThunkDef OnPingSceneObjectThunk;
-
-		static void internal_GetSceneObjectSelection(MonoArray** selection);
-		static void internal_SetSceneObjectSelection(MonoArray* selection);
-
-		static void internal_GetResourceUUIDSelection(MonoArray** selection);
-		static void internal_SetResourceUUIDSelection(MonoArray* selection);
-
-		static void internal_GetResourcePathSelection(MonoArray** selection);
-		static void internal_SetResourcePathSelection(MonoArray* selection);
-
-		static void internal_PingResource(MonoString* resourcePath);
-		static void internal_PingSceneObject(MonoObject* so);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for Selection. */
+	class BS_SCR_BED_EXPORT ScriptSelection : public ScriptObject<ScriptSelection>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Selection");
+
+		/**	Hooks up selection callbacks. Must be called on library load. */
+		static void startUp();
+
+		/**	Destroys selection callbacks. Must be called before library is unloaded. */
+		static void shutDown();
+
+	private:
+		ScriptSelection(MonoObject* instance);
+
+		/**
+		 * Triggered when selection has changed.
+		 *
+		 * @param[in]	sceneObject	Newly selected scene objects. This will be empty if no scene objects are selected or if
+		 *							selection hasn't changed.
+		 * @param[in]	resPaths	Paths to newly selected resources. This will be empty if no resources are selected or if
+		 *							selection hasn't changed.
+		 */
+		static void onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths);
+
+		/**	Triggered when ping action is requested for the resource at the specified path. */
+		static void onResourcePing(const Path& resPath);
+
+		/**	Triggered when ping action is requested for the specified scene object. */
+		static void onSceneObjectPing(const HSceneObject& sceneObject);
+
+		static HEvent OnSelectionChangedConn;
+		static HEvent OnPingResourceConn;
+		static HEvent OnPingSceneObjectConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoArray*, MonoArray*, MonoException**);
+		typedef void(__stdcall *OnPingResourceThunkDef) (MonoString*, MonoException**);
+		typedef void(__stdcall *OnPingSceneObjectThunkDef) (MonoObject*, MonoException**);
+
+		static OnSelectionChangedThunkDef OnSelectionChangedThunk;
+		static OnPingResourceThunkDef OnPingResourceThunk;
+		static OnPingSceneObjectThunkDef OnPingSceneObjectThunk;
+
+		static void internal_GetSceneObjectSelection(MonoArray** selection);
+		static void internal_SetSceneObjectSelection(MonoArray* selection);
+
+		static void internal_GetResourceUUIDSelection(MonoArray** selection);
+		static void internal_SetResourceUUIDSelection(MonoArray* selection);
+
+		static void internal_GetResourcePathSelection(MonoArray** selection);
+		static void internal_SetResourcePathSelection(MonoArray* selection);
+
+		static void internal_PingResource(MonoString* resourcePath);
+		static void internal_PingSceneObject(MonoObject* so);
+	};
+
+	/** @} */
 }

+ 43 - 39
Source/SBansheeEditor/Include/BsScriptUndoRedo.h

@@ -1,40 +1,44 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for UndoRedo.
-	 */
-	class BS_SCR_BED_EXPORT ScriptUndoRedo : public ScriptObject <ScriptUndoRedo>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "UndoRedo");
-
-	private:
-		ScriptUndoRedo(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_Undo();
-		static void internal_Redo();
-		static void internal_PushGroup(MonoString* name);
-		static void internal_PopGroup(MonoString* name);
-		static UINT32 internal_GetTopCommandId();
-		static void internal_PopCommand(UINT32 id);
-		static void internal_RecordSO(ScriptSceneObject* soPtr, bool recordHierarchy, MonoString* description);
-		static MonoObject* internal_CloneSO(ScriptSceneObject* soPtr, MonoString* description);
-		static MonoArray* internal_CloneSOMulti(MonoArray* soPtrs, MonoString* description);
-		static MonoObject* internal_Instantiate(ScriptPrefab* prefabPtr, MonoString* description);
-		static MonoObject* internal_CreateSO(MonoString* name, MonoString* description);
-		static void internal_DeleteSO(ScriptSceneObject* soPtr, MonoString* description);
-		static void internal_ReparentSO(ScriptSceneObject* soPtr, ScriptSceneObject* parentSOPtr, MonoString* description);
-		static void internal_ReparentSOMulti(MonoArray* soPtrs, ScriptSceneObject* parentSOPtr, MonoString* description);
-		static void internal_BreakPrefab(ScriptSceneObject* soPtr, MonoString* description);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for UndoRedo. */
+	class BS_SCR_BED_EXPORT ScriptUndoRedo : public ScriptObject <ScriptUndoRedo>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "UndoRedo");
+
+	private:
+		ScriptUndoRedo(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_Undo();
+		static void internal_Redo();
+		static void internal_PushGroup(MonoString* name);
+		static void internal_PopGroup(MonoString* name);
+		static UINT32 internal_GetTopCommandId();
+		static void internal_PopCommand(UINT32 id);
+		static void internal_RecordSO(ScriptSceneObject* soPtr, bool recordHierarchy, MonoString* description);
+		static MonoObject* internal_CloneSO(ScriptSceneObject* soPtr, MonoString* description);
+		static MonoArray* internal_CloneSOMulti(MonoArray* soPtrs, MonoString* description);
+		static MonoObject* internal_Instantiate(ScriptPrefab* prefabPtr, MonoString* description);
+		static MonoObject* internal_CreateSO(MonoString* name, MonoString* description);
+		static void internal_DeleteSO(ScriptSceneObject* soPtr, MonoString* description);
+		static void internal_ReparentSO(ScriptSceneObject* soPtr, ScriptSceneObject* parentSOPtr, MonoString* description);
+		static void internal_ReparentSOMulti(MonoArray* soPtrs, ScriptSceneObject* parentSOPtr, MonoString* description);
+		static void internal_BreakPrefab(ScriptSceneObject* soPtr, MonoString* description);
+	};
+
+	/** @} */
 }

+ 36 - 34
Source/SBansheeEditor/Include/BsScriptUnitTests.h

@@ -1,35 +1,37 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for various managed unit tests.
-	 */
-	class BS_SCR_BED_EXPORT ScriptUnitTests : public ScriptObject <ScriptUnitTests>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "UnitTests")
-
-		/**
-		 * @brief	Starts execution of the managed tests.
-		 */
-		static void runTests();
-
-	private:
-		static MonoMethod* RunTestsMethod;
-
-		static SPtr<ManagedSerializableDiff> tempDiff;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_UT1_GameObjectClone(MonoObject* instance);
-		static void internal_UT3_GenerateDiff(MonoObject* oldObj, MonoObject* newObj);
-		static void internal_UT3_ApplyDiff(MonoObject* obj);
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEditor
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for various managed unit tests. */
+	class BS_SCR_BED_EXPORT ScriptUnitTests : public ScriptObject <ScriptUnitTests>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "UnitTests")
+
+		/**	Starts execution of the managed tests. */
+		static void runTests();
+
+	private:
+		static MonoMethod* RunTestsMethod;
+
+		static SPtr<ManagedSerializableDiff> tempDiff;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_UT1_GameObjectClone(MonoObject* instance);
+		static void internal_UT3_GenerateDiff(MonoObject* oldObj, MonoObject* newObj);
+		static void internal_UT3_ApplyDiff(MonoObject* obj);
+	};
+
+	/** @} */
 }

+ 68 - 68
Source/SBansheeEditor/Include/BsToolbarItemManager.h

@@ -1,69 +1,69 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Tracks toolbar items that are registered in managed code using the ToolbarItem
-	 *			attribute.
-	 */
-	class BS_SCR_BED_EXPORT ToolbarItemManager : public Module<ToolbarItemManager>
-	{
-	public:
-		ToolbarItemManager(ScriptAssemblyManager& scriptObjectManager);
-		~ToolbarItemManager();
-
-	private:
-		/**
-		 * @brief	Removes all managed toolbar items from the main menu.
-		 */
-		void clearToolbarItems();
-
-		/**
-		 * @brief	Reloads all assembly types and attempts to find uses of ToolbarItem. Old
-		 *			toolbar items are cleared and new are added.
-		 */
-		void reloadAssemblyData();
-
-		/**
-		 * @brief	Parse the provided method and detect whether it has a ToolbarItem attribute.
-		 *			If it has extract needed data from it.
-		 *
-		 * @param	method		Managed method to parse.
-		 * @param	name		Output name defined in the ToolbarItem attribute.
-		 * @param	icon		Texture defined in the ToolbarItem attribute.
-		 * @param	tooltip		Optional tooltip defined in the ToolbarItem attribute.
-		 * @param	priority	Menu item priority defined in the MenuItem attribute.
-		 * @param	separator	Should the separator be inserted before the menu item.
-		 *
-		 * @return	True if the method has a ToolbarItem attribute. If false is returned output parameters
-		 *			from this method are undefined.
-		 */
-		bool parseToolbarItemMethod(MonoMethod* method, String& name, HSpriteTexture& icon, HString& tooltip,
-			INT32& priority, bool& separator) const;
-
-		/**
-		 * @brief	Triggered when one of the managed toolbar items is clicked. 
-		 *
-		 * @param	method	Managed method that the ToolbarItem is referencing.
-		 */
-		static void toolbarItemCallback(MonoMethod* method);
-
-		ScriptAssemblyManager& mScriptObjectManager;
-		HEvent mDomainLoadedConn;
-
-		MonoClass* mToolbarItemAttribute;
-		MonoField* mNameField;
-		MonoField* mIconField;
-		MonoField* mBuiltinIconField;
-		MonoField* mTooltipField;
-		MonoField* mPriorityField;
-		MonoField* mSeparatorField;
-
-		Vector<String> mToolbarItems;
-	};
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup SBansheeEditor
+	 *  @{
+	 */
+
+	/** Tracks toolbar items that are registered in managed code using the ToolbarItem attribute. */
+	class BS_SCR_BED_EXPORT ToolbarItemManager : public Module<ToolbarItemManager>
+	{
+	public:
+		ToolbarItemManager(ScriptAssemblyManager& scriptObjectManager);
+		~ToolbarItemManager();
+
+	private:
+		/**	Removes all managed toolbar items from the main menu. */
+		void clearToolbarItems();
+
+		/**
+		 * Reloads all assembly types and attempts to find uses of ToolbarItem. Old toolbar items are cleared and new are
+		 * added.
+		 */
+		void reloadAssemblyData();
+
+		/**
+		 * Parse the provided method and detect whether it has a ToolbarItem attribute. If it has extract needed data from
+		 * it.
+		 *
+		 * @param[in]	method		Managed method to parse.
+		 * @param[in]	name		Output name defined in the ToolbarItem attribute.
+		 * @param[in]	icon		Texture defined in the ToolbarItem attribute.
+		 * @param[in]	tooltip		Optional tooltip defined in the ToolbarItem attribute.
+		 * @param[in]	priority	Menu item priority defined in the MenuItem attribute.
+		 * @param[in]	separator	Should the separator be inserted before the menu item.
+		 * @return					True if the method has a ToolbarItem attribute. If false is returned output parameters
+		 *							from this method are undefined.
+		 */
+		bool parseToolbarItemMethod(MonoMethod* method, String& name, HSpriteTexture& icon, HString& tooltip,
+			INT32& priority, bool& separator) const;
+
+		/**
+		 * Triggered when one of the managed toolbar items is clicked. 
+		 *
+		 * @param[in]	method	Managed method that the ToolbarItem is referencing.
+		 */
+		static void toolbarItemCallback(MonoMethod* method);
+
+		ScriptAssemblyManager& mScriptObjectManager;
+		HEvent mDomainLoadedConn;
+
+		MonoClass* mToolbarItemAttribute;
+		MonoField* mNameField;
+		MonoField* mIconField;
+		MonoField* mBuiltinIconField;
+		MonoField* mTooltipField;
+		MonoField* mPriorityField;
+		MonoField* mSeparatorField;
+
+		Vector<String> mToolbarItems;
+	};
+
+	/** @} */
 }

+ 1 - 1
Source/SBansheeEngine/Include/BsScriptEnginePrerequisites.h

@@ -23,7 +23,7 @@
 /** @addtogroup Plugins
 
 /** @defgroup SBansheeEngine SBansheeEngine
- *	Contains script interop objects and other scripting functionality.
+ *	Contains script interop objects and other scripting functionality for BansheeEngine.
  *  @{
  */
 

+ 1 - 3
Source/SBansheeEngine/Include/BsScriptTexture3D.h

@@ -24,9 +24,7 @@ namespace BansheeEngine
 
 		ScriptTexture3D(MonoObject* instance, const HTexture& texture);
 
-		/**
-		 * @brief	Creates an empty, uninitialized managed instance of the resource interop object.
-		 */
+		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
 		static MonoObject* createInstance();
 
 		/************************************************************************/

+ 102 - 104
Source/SBansheeEngine/Source/BsScriptDebug.cpp

@@ -1,105 +1,103 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsScriptDebug.h"
-#include "BsMonoManager.h"
-#include "BsMonoClass.h"
-#include "BsMonoMethod.h"
-#include "BsMonoUtil.h"
-#include "BsDebug.h"
-#include "BsScriptLogEntry.h"
-
-namespace BansheeEngine
-{
-	HEvent ScriptDebug::mOnLogEntryAddedConn;
-	ScriptDebug::OnAddedThunkDef ScriptDebug::onAddedThunk = nullptr;
-
-	/**
-	 * @brief	C++ version of the managed LogEntry structure.
-	 */
-	struct ScriptLogEntryData
-	{
-		UINT32 type;
-		MonoString* message;
-	};
-
-	ScriptDebug::ScriptDebug(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptDebug::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_Log", &ScriptDebug::internal_log);
-		metaData.scriptClass->addInternalCall("Internal_LogWarning", &ScriptDebug::internal_logWarning);
-		metaData.scriptClass->addInternalCall("Internal_LogError", &ScriptDebug::internal_logError);
-		metaData.scriptClass->addInternalCall("Internal_LogMessage", &ScriptDebug::internal_logMessage);
-		metaData.scriptClass->addInternalCall("Internal_Clear", &ScriptDebug::internal_clear);
-		metaData.scriptClass->addInternalCall("Internal_ClearType", &ScriptDebug::internal_clearType);
-		metaData.scriptClass->addInternalCall("Internal_GetMessages", &ScriptDebug::internal_getMessages);
-
-		onAddedThunk = (OnAddedThunkDef)metaData.scriptClass->getMethod("Internal_OnAdded", 2)->getThunk();
-	}
-
-	void ScriptDebug::startUp()
-	{
-		mOnLogEntryAddedConn = gDebug().onLogEntryAdded.connect(&ScriptDebug::onLogEntryAdded);
-	}
-
-	void ScriptDebug::shutDown()
-	{
-		mOnLogEntryAddedConn.disconnect();
-	}
-
-	void ScriptDebug::onLogEntryAdded(const LogEntry& entry)
-	{
-		MonoString* message = MonoUtil::stringToMono(entry.getMessage());
-
-		MonoUtil::invokeThunk(onAddedThunk, entry.getChannel(), message);
-	}
-
-	void ScriptDebug::internal_log(MonoString* message)
-	{
-		gDebug().logDebug(MonoUtil::monoToString(message));
-	}
-
-	void ScriptDebug::internal_logWarning(MonoString* message)
-	{
-		gDebug().logWarning(MonoUtil::monoToString(message));
-	}
-
-	void ScriptDebug::internal_logError(MonoString* message)
-	{
-		gDebug().logError(MonoUtil::monoToString(message));
-	}
-
-	void ScriptDebug::internal_logMessage(MonoString* message, UINT32 type)
-	{
-		gDebug().log(MonoUtil::monoToString(message), type);
-	}
-
-	void ScriptDebug::internal_clear()
-	{
-		gDebug().getLog().clear();
-	}
-
-	void ScriptDebug::internal_clearType(UINT32 type)
-	{
-		gDebug().getLog().clear(type);
-	}
-
-	MonoArray* ScriptDebug::internal_getMessages()
-	{
-		Vector<LogEntry> entries = gDebug().getLog().getEntries();
-
-		UINT32 numEntries = (UINT32)entries.size();
-		ScriptArray output = ScriptArray::create<ScriptLogEntry>(numEntries);
-		for (UINT32 i = 0; i < numEntries; i++)
-		{
-			MonoString* message = MonoUtil::stringToMono(entries[i].getMessage());
-
-			ScriptLogEntryData scriptEntry = { entries[i].getChannel(), message };
-			output.set(i, scriptEntry);
-		}
-
-		return output.getInternal();
-	}
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "BsScriptDebug.h"
+#include "BsMonoManager.h"
+#include "BsMonoClass.h"
+#include "BsMonoMethod.h"
+#include "BsMonoUtil.h"
+#include "BsDebug.h"
+#include "BsScriptLogEntry.h"
+
+namespace BansheeEngine
+{
+	HEvent ScriptDebug::mOnLogEntryAddedConn;
+	ScriptDebug::OnAddedThunkDef ScriptDebug::onAddedThunk = nullptr;
+
+	/**	C++ version of the managed LogEntry structure. */
+	struct ScriptLogEntryData
+	{
+		UINT32 type;
+		MonoString* message;
+	};
+
+	ScriptDebug::ScriptDebug(MonoObject* instance)
+		:ScriptObject(instance)
+	{ }
+
+	void ScriptDebug::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_Log", &ScriptDebug::internal_log);
+		metaData.scriptClass->addInternalCall("Internal_LogWarning", &ScriptDebug::internal_logWarning);
+		metaData.scriptClass->addInternalCall("Internal_LogError", &ScriptDebug::internal_logError);
+		metaData.scriptClass->addInternalCall("Internal_LogMessage", &ScriptDebug::internal_logMessage);
+		metaData.scriptClass->addInternalCall("Internal_Clear", &ScriptDebug::internal_clear);
+		metaData.scriptClass->addInternalCall("Internal_ClearType", &ScriptDebug::internal_clearType);
+		metaData.scriptClass->addInternalCall("Internal_GetMessages", &ScriptDebug::internal_getMessages);
+
+		onAddedThunk = (OnAddedThunkDef)metaData.scriptClass->getMethod("Internal_OnAdded", 2)->getThunk();
+	}
+
+	void ScriptDebug::startUp()
+	{
+		mOnLogEntryAddedConn = gDebug().onLogEntryAdded.connect(&ScriptDebug::onLogEntryAdded);
+	}
+
+	void ScriptDebug::shutDown()
+	{
+		mOnLogEntryAddedConn.disconnect();
+	}
+
+	void ScriptDebug::onLogEntryAdded(const LogEntry& entry)
+	{
+		MonoString* message = MonoUtil::stringToMono(entry.getMessage());
+
+		MonoUtil::invokeThunk(onAddedThunk, entry.getChannel(), message);
+	}
+
+	void ScriptDebug::internal_log(MonoString* message)
+	{
+		gDebug().logDebug(MonoUtil::monoToString(message));
+	}
+
+	void ScriptDebug::internal_logWarning(MonoString* message)
+	{
+		gDebug().logWarning(MonoUtil::monoToString(message));
+	}
+
+	void ScriptDebug::internal_logError(MonoString* message)
+	{
+		gDebug().logError(MonoUtil::monoToString(message));
+	}
+
+	void ScriptDebug::internal_logMessage(MonoString* message, UINT32 type)
+	{
+		gDebug().log(MonoUtil::monoToString(message), type);
+	}
+
+	void ScriptDebug::internal_clear()
+	{
+		gDebug().getLog().clear();
+	}
+
+	void ScriptDebug::internal_clearType(UINT32 type)
+	{
+		gDebug().getLog().clear(type);
+	}
+
+	MonoArray* ScriptDebug::internal_getMessages()
+	{
+		Vector<LogEntry> entries = gDebug().getLog().getEntries();
+
+		UINT32 numEntries = (UINT32)entries.size();
+		ScriptArray output = ScriptArray::create<ScriptLogEntry>(numEntries);
+		for (UINT32 i = 0; i < numEntries; i++)
+		{
+			MonoString* message = MonoUtil::stringToMono(entries[i].getMessage());
+
+			ScriptLogEntryData scriptEntry = { entries[i].getChannel(), message };
+			output.set(i, scriptEntry);
+		}
+
+		return output.getInternal();
+	}
 }

+ 162 - 164
Source/SBansheeEngine/Source/BsScriptShader.cpp

@@ -1,165 +1,163 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsScriptShader.h"
-#include "BsScriptResourceManager.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoArray.h"
-#include "BsMonoManager.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Shader parameter types that can be handled using managed code.
-	 */
-	enum class ShaderParameterType // Note: This must match C# ShaderParameterType enum
-	{
-		Float, Vector2, Vector3, Vector4, Color,
-		Matrix3, Matrix4, Texture2D,
-		Texture3D, TextureCube, Sampler
-	};
-
-	ScriptShader::ScriptShader(MonoObject* instance, const HShader& shader)
-		:TScriptResource(instance, shader)
-	{
-
-	}
-
-	void ScriptShader::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_GetShaderParameters", &ScriptShader::internal_GetShaderParameters);
-	}
-
-	void ScriptShader::internal_GetShaderParameters(ScriptShader* nativeInstance, MonoArray** outNames, 
-		MonoArray** outTypes, MonoArray** outVisibility)
-	{
-		HShader shader = nativeInstance->getHandle();
-		if (!shader.isLoaded())
-		{
-			ScriptArray names = ScriptArray::create<String>(0);
-			ScriptArray types = ScriptArray::create<UINT32>(0);
-			ScriptArray visibility = ScriptArray::create<bool>(0);
-
-			*outNames = names.getInternal();
-			*outTypes = types.getInternal();
-			*outVisibility = visibility.getInternal();
-			return;
-		}
-
-		const Map<String, SHADER_DATA_PARAM_DESC>& dataParams = shader->getDataParams();
-		const Map<String, SHADER_OBJECT_PARAM_DESC>& textureParams = shader->getTextureParams();
-		const Map<String, SHADER_OBJECT_PARAM_DESC>& samplerParams = shader->getSamplerParams();
-
-		struct ParamInfo
-		{
-			String name;
-			ShaderParameterType type;
-			bool internal;
-		};
-
-		Vector<ParamInfo> paramInfos;
-
-		// TODO - Ignoring int, bool, struct and non-square matrices
-		// TODO - Ignoring buffers and load/store textures
-		for (auto& param : dataParams)
-		{
-			ShaderParameterType type;
-			bool isValidType = false;
-			bool isInternal = !param.second.rendererSemantic.empty();
-			switch (param.second.type) 
-			{
-			case GPDT_FLOAT1:
-				type = ShaderParameterType::Float;
-				isValidType = true;
-				break;
-			case GPDT_FLOAT2:
-				type = ShaderParameterType::Vector2;
-				isValidType = true;
-				break;
-			case GPDT_FLOAT3:
-				type = ShaderParameterType::Vector3;
-				isValidType = true;
-				break;
-			case GPDT_FLOAT4:
-				type = ShaderParameterType::Vector4;
-				isValidType = true;
-				break;
-			case GPDT_MATRIX_3X3:
-				type = ShaderParameterType::Matrix3;
-				isValidType = true;
-				break;
-			case GPDT_MATRIX_4X4:
-				type = ShaderParameterType::Matrix4;
-				isValidType = true;
-				break;
-			case GPDT_COLOR:
-				type = ShaderParameterType::Color;
-				isValidType = true;
-				break;
-			}
-
-			if (isValidType)
-				paramInfos.push_back({ param.first, type, isInternal });
-		}
-
-		for (auto& param : textureParams)
-		{
-			ShaderParameterType type;
-			bool isValidType = false;
-			bool isInternal = !param.second.rendererSemantic.empty();
-			switch (param.second.type)
-			{
-			case GPOT_TEXTURE2D:
-			case GPOT_TEXTURE2DMS:
-				type = ShaderParameterType::Texture2D;
-				isValidType = true;
-				break;
-			case GPOT_TEXTURE3D:
-				type = ShaderParameterType::Texture3D;
-				isValidType = true;
-				break;
-			case GPOT_TEXTURECUBE:
-				type = ShaderParameterType::TextureCube;
-				isValidType = true;
-				break;
-			}
-
-			if (isValidType)
-				paramInfos.push_back({ param.first, type, isInternal });
-		}
-
-		for (auto& param : samplerParams)
-		{
-			ShaderParameterType type = ShaderParameterType::Sampler;
-			bool isInternal = !param.second.rendererSemantic.empty();
-			paramInfos.push_back({ param.first, type, isInternal });
-		}
-
-
-		UINT32 totalNumParams = (UINT32)paramInfos.size();
-
-		ScriptArray names = ScriptArray::create<String>(totalNumParams);
-		ScriptArray types = ScriptArray::create<UINT32>(totalNumParams);
-		ScriptArray visibility = ScriptArray::create<bool>(totalNumParams);
-
-		UINT32 idx = 0;
-		for (auto& param : paramInfos)
-		{
-			names.set(idx, param.name);
-			types.set(idx, param.type);
-			visibility.set(idx, param.internal);
-
-			idx++;
-		}
-
-		*outNames = names.getInternal();
-		*outTypes = types.getInternal();
-		*outVisibility = visibility.getInternal();
-	}
-
-	MonoObject* ScriptShader::createInstance()
-	{
-		return metaData.scriptClass->createInstance();
-	}
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "BsScriptShader.h"
+#include "BsScriptResourceManager.h"
+#include "BsScriptMeta.h"
+#include "BsMonoField.h"
+#include "BsMonoClass.h"
+#include "BsMonoArray.h"
+#include "BsMonoManager.h"
+
+namespace BansheeEngine
+{
+	/**	Shader parameter types that can be handled using managed code. */
+	enum class ShaderParameterType // Note: This must match C# ShaderParameterType enum
+	{
+		Float, Vector2, Vector3, Vector4, Color,
+		Matrix3, Matrix4, Texture2D,
+		Texture3D, TextureCube, Sampler
+	};
+
+	ScriptShader::ScriptShader(MonoObject* instance, const HShader& shader)
+		:TScriptResource(instance, shader)
+	{
+
+	}
+
+	void ScriptShader::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_GetShaderParameters", &ScriptShader::internal_GetShaderParameters);
+	}
+
+	void ScriptShader::internal_GetShaderParameters(ScriptShader* nativeInstance, MonoArray** outNames, 
+		MonoArray** outTypes, MonoArray** outVisibility)
+	{
+		HShader shader = nativeInstance->getHandle();
+		if (!shader.isLoaded())
+		{
+			ScriptArray names = ScriptArray::create<String>(0);
+			ScriptArray types = ScriptArray::create<UINT32>(0);
+			ScriptArray visibility = ScriptArray::create<bool>(0);
+
+			*outNames = names.getInternal();
+			*outTypes = types.getInternal();
+			*outVisibility = visibility.getInternal();
+			return;
+		}
+
+		const Map<String, SHADER_DATA_PARAM_DESC>& dataParams = shader->getDataParams();
+		const Map<String, SHADER_OBJECT_PARAM_DESC>& textureParams = shader->getTextureParams();
+		const Map<String, SHADER_OBJECT_PARAM_DESC>& samplerParams = shader->getSamplerParams();
+
+		struct ParamInfo
+		{
+			String name;
+			ShaderParameterType type;
+			bool internal;
+		};
+
+		Vector<ParamInfo> paramInfos;
+
+		// TODO - Ignoring int, bool, struct and non-square matrices
+		// TODO - Ignoring buffers and load/store textures
+		for (auto& param : dataParams)
+		{
+			ShaderParameterType type;
+			bool isValidType = false;
+			bool isInternal = !param.second.rendererSemantic.empty();
+			switch (param.second.type) 
+			{
+			case GPDT_FLOAT1:
+				type = ShaderParameterType::Float;
+				isValidType = true;
+				break;
+			case GPDT_FLOAT2:
+				type = ShaderParameterType::Vector2;
+				isValidType = true;
+				break;
+			case GPDT_FLOAT3:
+				type = ShaderParameterType::Vector3;
+				isValidType = true;
+				break;
+			case GPDT_FLOAT4:
+				type = ShaderParameterType::Vector4;
+				isValidType = true;
+				break;
+			case GPDT_MATRIX_3X3:
+				type = ShaderParameterType::Matrix3;
+				isValidType = true;
+				break;
+			case GPDT_MATRIX_4X4:
+				type = ShaderParameterType::Matrix4;
+				isValidType = true;
+				break;
+			case GPDT_COLOR:
+				type = ShaderParameterType::Color;
+				isValidType = true;
+				break;
+			}
+
+			if (isValidType)
+				paramInfos.push_back({ param.first, type, isInternal });
+		}
+
+		for (auto& param : textureParams)
+		{
+			ShaderParameterType type;
+			bool isValidType = false;
+			bool isInternal = !param.second.rendererSemantic.empty();
+			switch (param.second.type)
+			{
+			case GPOT_TEXTURE2D:
+			case GPOT_TEXTURE2DMS:
+				type = ShaderParameterType::Texture2D;
+				isValidType = true;
+				break;
+			case GPOT_TEXTURE3D:
+				type = ShaderParameterType::Texture3D;
+				isValidType = true;
+				break;
+			case GPOT_TEXTURECUBE:
+				type = ShaderParameterType::TextureCube;
+				isValidType = true;
+				break;
+			}
+
+			if (isValidType)
+				paramInfos.push_back({ param.first, type, isInternal });
+		}
+
+		for (auto& param : samplerParams)
+		{
+			ShaderParameterType type = ShaderParameterType::Sampler;
+			bool isInternal = !param.second.rendererSemantic.empty();
+			paramInfos.push_back({ param.first, type, isInternal });
+		}
+
+
+		UINT32 totalNumParams = (UINT32)paramInfos.size();
+
+		ScriptArray names = ScriptArray::create<String>(totalNumParams);
+		ScriptArray types = ScriptArray::create<UINT32>(totalNumParams);
+		ScriptArray visibility = ScriptArray::create<bool>(totalNumParams);
+
+		UINT32 idx = 0;
+		for (auto& param : paramInfos)
+		{
+			names.set(idx, param.name);
+			types.set(idx, param.type);
+			visibility.set(idx, param.internal);
+
+			idx++;
+		}
+
+		*outNames = names.getInternal();
+		*outTypes = types.getInternal();
+		*outVisibility = visibility.getInternal();
+	}
+
+	MonoObject* ScriptShader::createInstance()
+	{
+		return metaData.scriptClass->createInstance();
+	}
 }