Explorar el Código

Documentation

Marko Pintera hace 10 años
padre
commit
15fc707495

+ 1 - 0
MBansheeEditor/Scene/DrawGizmo.cs

@@ -2,6 +2,7 @@
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
+    // Note: Must match the C++ enum DrawGizmoFlags
     public enum DrawGizmoFlags
     public enum DrawGizmoFlags
     {
     {
         Selected = 0x01,
         Selected = 0x01,

+ 6 - 0
SBansheeEditor/Include/BsScriptEditorTestSuite.h

@@ -5,12 +5,18 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Performs editor managed unit tests.
+	 */
 	class ScriptEditorTestSuite : public TestSuite
 	class ScriptEditorTestSuite : public TestSuite
 	{
 	{
 	public:
 	public:
 		ScriptEditorTestSuite();
 		ScriptEditorTestSuite();
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggers execution of managed unit tests.
+		 */
 		void runManagedTests();
 		void runManagedTests();
 	};
 	};
 }
 }

+ 8 - 2
SBansheeEditor/Include/BsScriptEditorUtility.h

@@ -5,15 +5,21 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for EditorUtility.
+	 */
 	class BS_SCR_BED_EXPORT ScriptEditorUtility : public ScriptObject <ScriptEditorUtility>
 	class BS_SCR_BED_EXPORT ScriptEditorUtility : public ScriptObject <ScriptEditorUtility>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorUtility")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "EditorUtility")
 
 
 	private:
 	private:
+		ScriptEditorUtility(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_CalculateBounds(MonoObject* so, AABox* bounds);
 		static void internal_CalculateBounds(MonoObject* so, AABox* bounds);
 		static void internal_CalculateBoundsArray(MonoArray* objects, AABox* bounds);
 		static void internal_CalculateBoundsArray(MonoArray* objects, AABox* bounds);
-
-		ScriptEditorUtility(MonoObject* instance);
 	};
 	};
 }
 }

+ 123 - 10
SBansheeEditor/Include/BsScriptEditorWindow.h

@@ -9,8 +9,14 @@ namespace BansheeEngine
 {
 {
 	class ScriptEditorWidget;
 	class ScriptEditorWidget;
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for ScriptEditorWidget.
+	 */
 	class BS_SCR_BED_EXPORT ScriptEditorWindow : public ScriptObject<ScriptEditorWindow, PersistentScriptObjectBase>
 	class BS_SCR_BED_EXPORT ScriptEditorWindow : public ScriptObject<ScriptEditorWindow, PersistentScriptObjectBase>
 	{
 	{
+		/**
+		 * @brief	Contains data about the managed handle to an editor window.
+		 */
 		struct EditorWindowHandle
 		struct EditorWindowHandle
 		{
 		{
 			uint32_t gcHandle;
 			uint32_t gcHandle;
@@ -21,10 +27,26 @@ namespace BansheeEngine
 
 
 		~ScriptEditorWindow();
 		~ScriptEditorWindow();
 
 
+		/**
+		 * @brief	Returns the internal wrapped editor widget.
+		 */
 		EditorWidgetBase* getEditorWidget() const;
 		EditorWidgetBase* getEditorWidget() const;
+
+		/**
+		 * @brief	Checks has the native widget been destroyed.
+		 */
 		bool isDestroyed() const { return mIsDestroyed; }
 		bool isDestroyed() const { return mIsDestroyed; }
 
 
+		/**
+		 * @brief	Finds all editor window implementations in managed assemblies and registers
+		 *			them with the editor widget system.
+		 */
 		static void registerManagedEditorWindows();
 		static void registerManagedEditorWindows();
+
+		/**
+		 * @brief	Removes all editor widgets registered previously with ::registerManagedEditorWindows.
+		 *			Useful during assembly refresh when editor window implementations might be added/removed.
+		 */
 		static void clearRegisteredEditorWindow();
 		static void clearRegisteredEditorWindow();
 
 
 	private:
 	private:
@@ -32,22 +54,39 @@ namespace BansheeEngine
 
 
 		ScriptEditorWindow(ScriptEditorWidget* editorWidget);
 		ScriptEditorWindow(ScriptEditorWidget* editorWidget);
 
 
-		static MonoObject* internal_createOrGetInstance(MonoString* ns, MonoString* typeName);
-		static MonoObject* internal_getInstance(MonoString* ns, MonoString* typeName);
-
-		static bool internal_hasFocus(ScriptEditorWindow* thisPtr);
-		static void internal_screenToWindowPos(ScriptEditorWindow* thisPtr, Vector2I screenPos, Vector2I* windowPos);
-		static void internal_windowToScreenPos(ScriptEditorWindow* thisPtr, Vector2I windowPos, Vector2I* screenPos);
-		static UINT32 internal_getWidth(ScriptEditorWindow* thisPtr);
-		static UINT32 internal_getHeight(ScriptEditorWindow* thisPtr);
-
+		/**
+		 * @brief	Triggered when the native editor widget is resized.
+		 */
 		void onWidgetResized(UINT32 width, UINT32 height);
 		void onWidgetResized(UINT32 width, UINT32 height);
+
+		/**
+		 * @brief	Triggered when the native editor widget gains or loses focus.
+		 */
 		void onFocusChanged(bool inFocus);
 		void onFocusChanged(bool inFocus);
+
+		/**
+		 * @brief	Triggered when assembly refresh has started.
+		 */
 		void onAssemblyRefreshStarted();
 		void onAssemblyRefreshStarted();
 
 
+		/**
+		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
+		 */
 		void _onManagedInstanceDeleted() override;
 		void _onManagedInstanceDeleted() override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::beginRefresh
+		 */
 		ScriptObjectBackup beginRefresh() override;
 		ScriptObjectBackup beginRefresh() override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::endRefresh
+		 */
 		void endRefresh(const ScriptObjectBackup& backupData) override;
 		void endRefresh(const ScriptObjectBackup& backupData) override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::_createManagedInstance
+		 */
 		MonoObject* _createManagedInstance(bool construct) override;
 		MonoObject* _createManagedInstance(bool construct) override;
 
 
 		String mName;
 		String mName;
@@ -63,28 +102,102 @@ namespace BansheeEngine
 		static MonoField* guiPanelField;
 		static MonoField* guiPanelField;
 
 
 		// Global editor window management methods
 		// 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.
+		 */
 		static void registerScriptEditorWindow(ScriptEditorWindow* editorWindow);
 		static void registerScriptEditorWindow(ScriptEditorWindow* editorWindow);
+
+		/**
+		 * @brief	Removes a window from the active editor window list.
+		 *
+		 * @param	windowTypeName	Name of the window type. Provided by EditorWidget::getName.
+		 */
 		static void unregisterScriptEditorWindow(const String& windowTypeName);
 		static void unregisterScriptEditorWindow(const String& windowTypeName);
 
 
+		/**
+		* @brief	Callback that is triggered when user requests a widget to be opened.
+		*/
+		static EditorWidgetBase* openEditorWidgetCallback(String ns, String type, EditorWidgetContainer& parentContainer);
+
 		static UnorderedMap<String, EditorWindowHandle> OpenScriptEditorWindows;
 		static UnorderedMap<String, EditorWindowHandle> OpenScriptEditorWindows;
 		static Vector<String> AvailableWindowTypes;
 		static Vector<String> AvailableWindowTypes;
 
 
-		static EditorWidgetBase* openEditorWidgetCallback(String ns, String type, EditorWidgetContainer& parentContainer);
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static MonoObject* internal_createOrGetInstance(MonoString* ns, MonoString* typeName);
+		static MonoObject* internal_getInstance(MonoString* ns, MonoString* typeName);
+
+		static bool internal_hasFocus(ScriptEditorWindow* thisPtr);
+		static void internal_screenToWindowPos(ScriptEditorWindow* thisPtr, Vector2I screenPos, Vector2I* windowPos);
+		static void internal_windowToScreenPos(ScriptEditorWindow* thisPtr, Vector2I windowPos, Vector2I* screenPos);
+		static UINT32 internal_getWidth(ScriptEditorWindow* thisPtr);
+		static UINT32 internal_getHeight(ScriptEditorWindow* thisPtr);
+
 	};
 	};
 
 
+	/**
+	 * @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.
+	 */
 	class BS_SCR_BED_EXPORT ScriptEditorWidget : public EditorWidgetBase
 	class BS_SCR_BED_EXPORT ScriptEditorWidget : public EditorWidgetBase
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Constructs a new managed widget.
+		 *
+		 * @param	ns				Namespace of the widget type.
+		 * @param	type			Name of the widget type.
+		 * @param	parentContainer	Container to initially dock the widget in.
+		 */
 		ScriptEditorWidget(const String& ns, const String& type, EditorWidgetContainer& parentContainer);
 		ScriptEditorWidget(const String& ns, const String& type, EditorWidgetContainer& parentContainer);
 		~ScriptEditorWidget();
 		~ScriptEditorWidget();
 
 
+		/**
+		 * @brief	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();
 		bool createManagedInstance();
+
+		/**
+		 * @copydoc	EditorWidgetBase::update 
+		 */
 		void update() override;
 		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);
 		void reloadMonoTypes(MonoClass* windowClass);
+
+		/**
+		 * @brief	Triggers OnInitialize callbacks on the managed instance.
+		 */
 		void triggerOnInitialize();
 		void triggerOnInitialize();
+
+		/**
+		 * @brief	Triggers OnDestroy callbacks on the managed instance.
+		 */
 		void triggerOnDestroy();
 		void triggerOnDestroy();
 
 
+		/**
+		 * @brief	Sets the parent interop object that handles part of the communication
+		 *			between this object and the managed instance.
+		 */
 		void setScriptOwner(ScriptEditorWindow* owner) { mScriptOwner = owner; }
 		void setScriptOwner(ScriptEditorWindow* owner) { mScriptOwner = owner; }
+
+		/**
+		 * @brief	Returns the managed instance for the editor window
+		 *			represented by this object.
+		 */
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
 
 
 	private:
 	private:

+ 47 - 5
SBansheeEditor/Include/BsScriptFolderMonitor.h

@@ -7,6 +7,9 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for FolderMonitor.
+	 */
 	class BS_SCR_BED_EXPORT ScriptFolderMonitor : public ScriptObject <ScriptFolderMonitor>
 	class BS_SCR_BED_EXPORT ScriptFolderMonitor : public ScriptObject <ScriptFolderMonitor>
 	{
 	{
 	public:
 	public:
@@ -15,20 +18,47 @@ namespace BansheeEngine
 	private:
 	private:
 		friend class ScriptFolderMonitorManager;
 		friend class ScriptFolderMonitorManager;
 
 
-		static void internal_CreateInstance(MonoObject* instance, MonoString* folder);
-		static void internal_Destroy(ScriptFolderMonitor* thisPtr);
-
 		ScriptFolderMonitor(MonoObject* instance, FolderMonitor* monitor);
 		ScriptFolderMonitor(MonoObject* instance, FolderMonitor* monitor);
 		~ScriptFolderMonitor();
 		~ScriptFolderMonitor();
 
 
+		/**
+		 * @brief	Updates the native folder monitor. Must be called once per frame.
+		 */
 		void update();
 		void update();
+
+		/**
+		 * @brief	Destroys the native folder monitor.
+		 */
 		void destroy();
 		void destroy();
 
 
+		/**
+		 * @brief	Triggered when the native folder monitor detects a file has been modified.
+		 */
 		void onMonitorFileModified(const Path& path);
 		void onMonitorFileModified(const Path& path);
+
+		/**
+		 * @brief	Triggered when the native folder monitor detects a file has been added.
+		 */
 		void onMonitorFileAdded(const Path& path);
 		void onMonitorFileAdded(const Path& path);
+
+		/**
+		 * @brief	Triggered when the native folder monitor detects a file has been removed.
+		 */
 		void onMonitorFileRemoved(const Path& path);
 		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);
 		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 *OnModifiedThunkDef) (MonoObject*, MonoString*, MonoException**);
 		typedef void(__stdcall *OnRenamedThunkDef) (MonoObject*, MonoString*, MonoString*, MonoException**);
 		typedef void(__stdcall *OnRenamedThunkDef) (MonoObject*, MonoString*, MonoString*, MonoException**);
 
 
@@ -36,19 +66,31 @@ namespace BansheeEngine
 		static OnModifiedThunkDef OnAddedThunk;
 		static OnModifiedThunkDef OnAddedThunk;
 		static OnModifiedThunkDef OnRemovedThunk;
 		static OnModifiedThunkDef OnRemovedThunk;
 		static OnRenamedThunkDef OnRenamedThunk;
 		static OnRenamedThunkDef OnRenamedThunk;
-
-		FolderMonitor* mMonitor;
 	};
 	};
 
 
+	/**
+	 * @brief	Manages all active managed folder monitor objects.
+	 */
 	class BS_SCR_BED_EXPORT ScriptFolderMonitorManager : public Module<ScriptFolderMonitorManager>
 	class BS_SCR_BED_EXPORT ScriptFolderMonitorManager : public Module<ScriptFolderMonitorManager>
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Triggers updates on all active folder monitor objects. Should be called
+		 *			once per frame.
+		 */
 		void update();
 		void update();
 
 
 	private:
 	private:
 		friend class ScriptFolderMonitor;
 		friend class ScriptFolderMonitor;
 
 
+		/**
+		 * @brief	Registers a new managed folder monitor.
+		 */
 		void _registerMonitor(ScriptFolderMonitor* monitor);
 		void _registerMonitor(ScriptFolderMonitor* monitor);
+
+		/**
+		 * @brief	Unregisters a destroyed managed folder monitor.
+		 */
 		void _unregisterMonitor(ScriptFolderMonitor* monitor);
 		void _unregisterMonitor(ScriptFolderMonitor* monitor);
 
 
 		UnorderedSet<ScriptFolderMonitor*> mMonitors;
 		UnorderedSet<ScriptFolderMonitor*> mMonitors;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIColorField.h

@@ -6,12 +6,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIColorField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
 	class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
 
 
 	private:
 	private:
+		ScriptGUIColorField(MonoObject* instance, GUIColorField* colorField);
+
+		/**
+		 * @brief	Triggered when the value in the native color field changes.
+		 *
+		 * @param	instance	Managed GUIColorField instance.
+		 * @param	newValue	New color value.
+		 */
+		static void onChanged(MonoObject* instance, Color newValue);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUIColorField* nativeInstance, Color value);
 		static void internal_setValue(ScriptGUIColorField* nativeInstance, Color value);
 		static void internal_setTint(ScriptGUIColorField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIColorField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, Color newValue);
-
-		ScriptGUIColorField(MonoObject* instance, GUIColorField* colorField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Color, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Color, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 23 - 5
SBansheeEditor/Include/BsScriptGUIComponentFoldout.h

@@ -5,23 +5,41 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIComponentFoldout.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIComponentFoldout : public TScriptGUIElement<ScriptGUIComponentFoldout>
 	class BS_SCR_BED_EXPORT ScriptGUIComponentFoldout : public TScriptGUIElement<ScriptGUIComponentFoldout>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIComponentFoldout")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIComponentFoldout")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the foldout is expanded or collapsed.
+		 *
+		 * @param	instance	Managed GUIComponentFoldout instance.
+		 * @param	expanded	True if the foldout is now expanded, false otherwise.
+		 */
+		static void onToggled(MonoObject* instance, bool expanded);
+
+		/**
+		 * @brief	Triggered when the remove button on the foldout is clicked.
+		 *
+		 * @param	instance	Managed GUIComponentFoldout instance.
+		 */
+		static void onRemoveClicked(MonoObject* instance);
+
+		ScriptGUIComponentFoldout(MonoObject* instance, GUIComponentFoldout* foldout);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
 		static void internal_setContent(ScriptGUIComponentFoldout* nativeInstance, MonoObject* content);
 		static void internal_setContent(ScriptGUIComponentFoldout* nativeInstance, MonoObject* content);
 		static void internal_setExpanded(ScriptGUIComponentFoldout* nativeInstance, bool expanded);
 		static void internal_setExpanded(ScriptGUIComponentFoldout* nativeInstance, bool expanded);
 		static void internal_getIsExpanded(ScriptGUIComponentFoldout* nativeInstance, bool* isExpanded);
 		static void internal_getIsExpanded(ScriptGUIComponentFoldout* nativeInstance, bool* isExpanded);
 		static void internal_setTint(ScriptGUIComponentFoldout* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIComponentFoldout* nativeInstance, Color color);
 
 
-		static void onToggled(MonoObject* instance, bool expanded);
-		static void onRemoveClicked(MonoObject* instance);
-
-		ScriptGUIComponentFoldout(MonoObject* instance, GUIComponentFoldout* foldout);
-
 		typedef void (__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
 		typedef void (__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
 		typedef void(__stdcall *OnRemoveClickedThunkDef) (MonoObject*, MonoException**);
 		typedef void(__stdcall *OnRemoveClickedThunkDef) (MonoObject*, MonoException**);
 
 

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIFloatField.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIFloatField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
 	class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
 
 
 	private:
 	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);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, float newValue);
-
-		ScriptGUIFloatField(MonoObject* instance, GUIFloatField* floatField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIFoldout.h

@@ -5,22 +5,34 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIFoldout.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIFoldout : public TScriptGUIElement<ScriptGUIFoldout>
 	class BS_SCR_BED_EXPORT ScriptGUIFoldout : public TScriptGUIElement<ScriptGUIFoldout>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFoldout")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFoldout")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the foldout is expanded or collapsed.
+		 *
+		 * @param	instance	Managed GUIFoldout instance.
+		 * @param	expanded	True if the foldout is now expanded, false otherwise.
+		 */
+		static void onToggled(MonoObject* instance, bool expanded);
+
+		ScriptGUIFoldout(MonoObject* instance, GUIFoldout* foldout);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
 		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
 		static void internal_setContent(ScriptGUIFoldout* nativeInstance, MonoObject* content);
 		static void internal_setContent(ScriptGUIFoldout* nativeInstance, MonoObject* content);
 		static void internal_setExpanded(ScriptGUIFoldout* nativeInstance, bool expanded);
 		static void internal_setExpanded(ScriptGUIFoldout* nativeInstance, bool expanded);
 		static void internal_getIsExpanded(ScriptGUIFoldout* nativeInstance, bool* isExpanded);
 		static void internal_getIsExpanded(ScriptGUIFoldout* nativeInstance, bool* isExpanded);
 		static void internal_setTint(ScriptGUIFoldout* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIFoldout* nativeInstance, Color color);
 
 
-		static void onToggled(MonoObject* instance, bool expanded);
-
-		ScriptGUIFoldout(MonoObject* instance, GUIFoldout* foldout);
-
 		typedef void(__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
 		typedef void(__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
 
 
 		static OnToggledThunkDef onToggledThunk;
 		static OnToggledThunkDef onToggledThunk;

+ 22 - 4
SBansheeEditor/Include/BsScriptGUIGameObjectField.h

@@ -5,12 +5,34 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIGameObjectField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
 	class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
 
 
 	private:
 	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,
 		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -18,10 +40,6 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUIGameObjectField* nativeInstance, MonoObject* value);
 		static void internal_setValue(ScriptGUIGameObjectField* nativeInstance, MonoObject* value);
 		static void internal_setTint(ScriptGUIGameObjectField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIGameObjectField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, const HGameObject& newValue);
-		static MonoObject* nativeToManagedGO(const HGameObject& instance);
-
-		ScriptGUIGameObjectField(MonoObject* instance, GUIGameObjectField* GOField);
 
 
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 
 

+ 17 - 5
SBansheeEditor/Include/BsScriptGUIIntField.h

@@ -5,13 +5,29 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIIntField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
 	class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth, 
+		/**
+		 * @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);
+
+		ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
 		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
 		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
@@ -20,10 +36,6 @@ namespace BansheeEngine
 		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
 		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
 		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, INT32 newValue);
-
-		ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
-
 		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
 		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 22 - 5
SBansheeEditor/Include/BsScriptGUIResourceField.h

@@ -5,12 +5,34 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIResourceField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIResourceField : public TScriptGUIElement<ScriptGUIResourceField>
 	class BS_SCR_BED_EXPORT ScriptGUIResourceField : public TScriptGUIElement<ScriptGUIResourceField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIResourceField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIResourceField")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the value in the native resource field changes.
+		 *
+		 * @param	instance	Managed GUIResourceField instance.
+		 * @param	newValue	New field value.
+		 */
+		static void onChanged(MonoObject* instance, const HResource& newValue);
+
+		/**
+		 * @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,
 		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -18,11 +40,6 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUIResourceField* nativeInstance, MonoObject* value);
 		static void internal_setValue(ScriptGUIResourceField* nativeInstance, MonoObject* value);
 		static void internal_setTint(ScriptGUIResourceField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIResourceField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, const HResource& newValue);
-		static MonoObject* nativeToManagedResource(const HResource& instance);
-
-		ScriptGUIResourceField(MonoObject* instance, GUIResourceField* resourceField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 8 - 2
SBansheeEditor/Include/BsScriptGUISceneTreeView.h

@@ -5,15 +5,21 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUISceneTreeView.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUISceneTreeView : public TScriptGUIElement<ScriptGUISceneTreeView>
 	class BS_SCR_BED_EXPORT ScriptGUISceneTreeView : public TScriptGUIElement<ScriptGUISceneTreeView>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUISceneTreeView")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUISceneTreeView")
 
 
 	private:
 	private:
+		ScriptGUISceneTreeView(MonoObject* instance, GUISceneTreeView* treeView);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
 		static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
 		static void internal_update(ScriptGUISceneTreeView* thisPtr);
 		static void internal_update(ScriptGUISceneTreeView* thisPtr);
-
-		ScriptGUISceneTreeView(MonoObject* instance, GUISceneTreeView* treeView);
 	};
 	};
 }
 }

+ 16 - 4
SBansheeEditor/Include/BsScriptGUITextField.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUITextField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
 	class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextField")
 
 
 	private:
 	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);
+
+		ScriptGUITextField(MonoObject* instance, GUITextField* textField);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_hasInputFocus(ScriptGUITextField* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUITextField* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUITextField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUITextField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, const WString& newValue);
-
-		ScriptGUITextField(MonoObject* instance, GUITextField* textField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 23 - 5
SBansheeEditor/Include/BsScriptGUITextureField.h

@@ -5,12 +5,35 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUITextureField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
 	class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the value in the native texture field changes.
+		 *
+		 * @param	instance	Managed GUITextureField instance.
+		 * @param	newValue	New texture.
+		 */
+		static void onChanged(MonoObject* instance, const HTexture& newValue);
+
+		/**
+		 * @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,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -18,11 +41,6 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUITextureField* nativeInstance, MonoObject* value);
 		static void internal_setValue(ScriptGUITextureField* nativeInstance, MonoObject* value);
 		static void internal_setTint(ScriptGUITextureField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUITextureField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, const HTexture& newValue);
-		static MonoObject* nativeToManagedResource(const HTexture& instance);
-
-		ScriptGUITextureField(MonoObject* instance, GUITextureField* textureField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIToggleField.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIToggleField.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
 	class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
 
 
 	private:
 	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,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -18,10 +34,6 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
 		static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
 		static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, bool newValue);
-
-		ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIVector2Field.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIVector2Field.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIVector2Field : public TScriptGUIElement<ScriptGUIVector2Field>
 	class BS_SCR_BED_EXPORT ScriptGUIVector2Field : public TScriptGUIElement<ScriptGUIVector2Field>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector2Field")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector2Field")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the value in the native vector field changes.
+		 *
+		 * @param	instance	Managed GUIVector2Field instance.
+		 * @param	newValue	New vector value.
+		 */
+		static void onChanged(MonoObject* instance, Vector2 newValue);
+
+		ScriptGUIVector2Field(MonoObject* instance, GUIVector2Field* vector2Field);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_hasInputFocus(ScriptGUIVector2Field* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIVector2Field* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIVector2Field* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIVector2Field* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, Vector2 newValue);
-
-		ScriptGUIVector2Field(MonoObject* instance, GUIVector2Field* vector2Field);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector2, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector2, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIVector3Field.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIVector3Field.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIVector3Field : public TScriptGUIElement<ScriptGUIVector3Field>
 	class BS_SCR_BED_EXPORT ScriptGUIVector3Field : public TScriptGUIElement<ScriptGUIVector3Field>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector3Field")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector3Field")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the value in the native vector field changes.
+		 *
+		 * @param	instance	Managed GUIVector3Field instance.
+		 * @param	newValue	New vector value.
+		 */
+		static void onChanged(MonoObject* instance, Vector3 newValue);
+
+		ScriptGUIVector3Field(MonoObject* instance, GUIVector3Field* vector3Field);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_hasInputFocus(ScriptGUIVector3Field* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIVector3Field* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIVector3Field* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIVector3Field* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, Vector3 newValue);
-
-		ScriptGUIVector3Field(MonoObject* instance, GUIVector3Field* vector3Field);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector3, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector3, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 16 - 4
SBansheeEditor/Include/BsScriptGUIVector4Field.h

@@ -5,12 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIVector4Field.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGUIVector4Field : public TScriptGUIElement<ScriptGUIVector4Field>
 	class BS_SCR_BED_EXPORT ScriptGUIVector4Field : public TScriptGUIElement<ScriptGUIVector4Field>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector4Field")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIVector4Field")
 
 
 	private:
 	private:
+		/**
+		 * @brief	Triggered when the value in the native vector field changes.
+		 *
+		 * @param	instance	Managed GUIVector4Field instance.
+		 * @param	newValue	New vector value.
+		 */
+		static void onChanged(MonoObject* instance, Vector4 newValue);
+
+		ScriptGUIVector4Field(MonoObject* instance, GUIVector4Field* vector4Field);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
@@ -19,10 +35,6 @@ namespace BansheeEngine
 		static void internal_hasInputFocus(ScriptGUIVector4Field* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIVector4Field* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIVector4Field* nativeInstance, Color color);
 		static void internal_setTint(ScriptGUIVector4Field* nativeInstance, Color color);
 
 
-		static void onChanged(MonoObject* instance, Vector4 newValue);
-
-		ScriptGUIVector4Field(MonoObject* instance, GUIVector4Field* vector4Field);
-
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector4, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Vector4, MonoException**);
 
 
 		static OnChangedThunkDef onChangedThunk;
 		static OnChangedThunkDef onChangedThunk;

+ 35 - 7
SBansheeEditor/Include/BsScriptGizmoManager.h

@@ -5,31 +5,59 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Available flags to be used when defining gizmos.
+	 */
+	// Note: Must match the C# enum DrawGizmoFlags
 	enum class DrawGizmoFlags
 	enum class DrawGizmoFlags
 	{
 	{
-		Selected = 0x01,
-		ParentSelected = 0x02,
-		NotSelected = 0x04,
-		Pickable = 0x08
+		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 (selected). */
 	};
 	};
 
 
+	/**
+	 * @brief	Manages all active managed gizmo methods.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGizmoManager : public Module<ScriptGizmoManager>
 	class BS_SCR_BED_EXPORT ScriptGizmoManager : public Module<ScriptGizmoManager>
 	{
 	{
+		/**
+		 * @brief	Data about a managed gizmo method.
+		 */
 		struct GizmoData
 		struct GizmoData
 		{
 		{
-			MonoClass* componentType;
-			MonoMethod* drawGizmosMethod;
-			UINT32 flags;
+			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:
 	public:
 		ScriptGizmoManager(ScriptAssemblyManager& scriptObjectManager);
 		ScriptGizmoManager(ScriptAssemblyManager& scriptObjectManager);
 		~ScriptGizmoManager();
 		~ScriptGizmoManager();
 
 
+		/**
+		 * @brief	Iterates over all managed gizmos, calls their draw methods and registers
+		 *			the gizmos with the native GizmoManager.
+		 */
 		void update();
 		void update();
 
 
 	private:
 	private:
+		/**
+		 * @brief	Finds all gizmo methods (marked with the DrawGizmo attribute). Clears any previously found methods.
+		 */
 		void reloadAssemblyData();
 		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);
 		bool isValidDrawGizmoMethod(MonoMethod* method, MonoClass*& componentType, UINT32& drawGizmoFlags);
 
 
 		ScriptAssemblyManager& mScriptObjectManager;
 		ScriptAssemblyManager& mScriptObjectManager;

+ 6 - 0
SBansheeEditor/Include/BsScriptGizmos.h

@@ -8,12 +8,18 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GizmoManager.
+	 */
 	class BS_SCR_BED_EXPORT ScriptGizmos : public ScriptObject<ScriptGizmos>
 	class BS_SCR_BED_EXPORT ScriptGizmos : public ScriptObject<ScriptGizmos>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Gizmos")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "Gizmos")
 
 
 	private:
 	private:
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_SetColor(Color color);
 		static void internal_SetColor(Color color);
 		static void internal_GetColor(Color* color);
 		static void internal_GetColor(Color* color);
 		static void internal_SetTransform(Matrix4 transform);
 		static void internal_SetTransform(Matrix4 transform);

+ 16 - 10
SBansheeEditor/Source/BsScriptEditorWindow.cpp

@@ -333,22 +333,28 @@ namespace BansheeEngine
 
 
 	bool ScriptEditorWidget::createManagedInstance()
 	bool ScriptEditorWidget::createManagedInstance()
 	{
 	{
-		MonoAssembly* assembly = MonoManager::instance().getAssembly(EDITOR_ASSEMBLY);
+		const char* assemblies[2] = { EDITOR_ASSEMBLY, SCRIPT_EDITOR_ASSEMBLY };
+		UINT32 numAssemblies = sizeof(assemblies) / sizeof(assemblies[0]);
 
 
-		if (assembly != nullptr)
+		for (UINT32 i = 0; i < numAssemblies; i++)
 		{
 		{
-			MonoClass* editorWindowClass = assembly->getClass(mNamespace, mTypename);
+			MonoAssembly* assembly = MonoManager::instance().getAssembly(assemblies[i]);
 
 
-			if (editorWindowClass != nullptr)
+			if (assembly != nullptr)
 			{
 			{
-				mManagedInstance = editorWindowClass->createInstance();
+				MonoClass* editorWindowClass = assembly->getClass(mNamespace, mTypename);
+
+				if (editorWindowClass != nullptr)
+				{
+					mManagedInstance = editorWindowClass->createInstance();
 
 
-				MonoObject* guiPanel = ScriptGUIPanel::createFromExisting(mContent);
-				mContentsPanel = ScriptGUILayout::toNative(guiPanel);
-				ScriptEditorWindow::guiPanelField->setValue(mManagedInstance, guiPanel);
+					MonoObject* guiPanel = ScriptGUIPanel::createFromExisting(mContent);
+					mContentsPanel = ScriptGUILayout::toNative(guiPanel);
+					ScriptEditorWindow::guiPanelField->setValue(mManagedInstance, guiPanel);
 
 
-				reloadMonoTypes(editorWindowClass);
-				return true;
+					reloadMonoTypes(editorWindowClass);
+					return true;
+				}
 			}
 			}
 		}
 		}
 
 

+ 0 - 1
TODO.txt

@@ -72,7 +72,6 @@ First screenshot:
   - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
   - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
   - Help - About, API Reference (link to site)
   - Help - About, API Reference (link to site)
- - Modify inspector looks by scaling down transform input box sizes, and properly aligning component entries
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
    - Foldout in scene tree view is hard to click, make it bigger
    - Foldout in scene tree view is hard to click, make it bigger
  - (Optionally) Console window
  - (Optionally) Console window