BearishSun преди 10 години
родител
ревизия
addd559d0a

+ 0 - 19
MBansheeEditor/DbgCustomInspector.cs

@@ -1,19 +0,0 @@
-using System;
-using BansheeEngine;
-
-namespace BansheeEditor
-{
-    [CustomInspector(typeof(Camera))]
-    public class DbgCustomInspector : Inspector
-    {
-        internal override bool Refresh()
-        {
-            throw new NotImplementedException();
-        }
-
-        internal override int GetOptimalHeight()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

+ 10 - 5
MBansheeEditor/Inspector/GenericInspector.cs

@@ -7,12 +7,17 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Default implementation of the inspector used when no specified inspector is provided for the type. Inspector 
+    /// displays GUI for all the inspectable fields in the object.
+    /// </summary>
     internal sealed class GenericInspector : Inspector
     {
         private GUIPanel RootGUI;
         private bool isInitialized;
         private List<InspectableField> inspectableFields = new List<InspectableField>();
 
+        /// <inheritdoc/>
         internal override void Initialize(InspectorWindow parentWindow, GUIPanel gui, object instance)
         {
             RootGUI = gui;
@@ -32,11 +37,15 @@ namespace BansheeEditor
             base.Initialize(parentWindow, contentPanel, instance);
         }
 
+        /// <inheritdoc/>
         internal override void SetVisible(bool visible)
         {
             RootGUI.Visible = visible;
         }
 
+        /// <summary>
+        /// Initializes required data the first time <see cref="Refresh"/> is called.
+        /// </summary>
         private void Initialize()
         {
             if (referencedObject != null)
@@ -55,6 +64,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         internal override bool Refresh()
         {
             if (!isInitialized)
@@ -71,10 +81,5 @@ namespace BansheeEditor
 
             return anythingModified;
         }
-
-        internal override int GetOptimalHeight()
-        {
-            return GUILayoutUtility.CalculateOptimalSize(layout).y;
-        }
     }
 }

+ 68 - 1
MBansheeEditor/Inspector/InspectableArray.cs

@@ -7,8 +7,15 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing an array. Array contents are displayed as rows of entries 
+    /// that can be shown, hidden or manipulated.
+    /// </summary>
     public class InspectableArray : InspectableField
     {
+        /// <summary>
+        /// Contains GUI elements for a single entry in the array.
+        /// </summary>
         private class EntryRow
         {
             public GUILayoutY contentLayout;
@@ -16,12 +23,22 @@ namespace BansheeEditor
             private GUILayoutX titleLayout;
             private bool ownsTitleLayout;
 
+            /// <summary>
+            /// Constructs a new entry row object.
+            /// </summary>
+            /// <param name="parentLayout">Parent layout that row GUI elements will be added to.</param>
             public EntryRow(GUILayout parentLayout)
             {
                 rowLayout = parentLayout.AddLayoutX();
                 contentLayout = rowLayout.AddLayoutY();
             }
 
+            /// <summary>
+            /// Recreates all row GUI elements.
+            /// </summary>
+            /// <param name="child">Inspectable field of the array entry.</param>
+            /// <param name="seqIndex">Sequential index of the array entry.</param>
+            /// <param name="parent">Parent array object that the entry is contained in.</param>
             public void Refresh(InspectableField child, int seqIndex, InspectableArray parent)
             {
                 if (ownsTitleLayout || (titleLayout != null && titleLayout == child.GetTitleLayout()))
@@ -54,6 +71,9 @@ namespace BansheeEditor
                 titleLayout.AddElement(moveDownBtn);
             }
 
+            /// <summary>
+            /// Destroys all row GUI elements.
+            /// </summary>
             public void Destroy()
             {
                 rowLayout.Destroy();
@@ -73,17 +93,27 @@ namespace BansheeEditor
 
         private bool forceUpdate = true;
 
+        /// <summary>
+        /// Creates a new inspectable array GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field.Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableArray(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <inheritdoc/>
         public override GUILayoutX GetTitleLayout()
         {
             return guiTitleLayout;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (forceUpdate)
@@ -103,6 +133,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         public override bool Refresh(int layoutIndex)
         {
             bool anythingModified = false;
@@ -113,7 +144,7 @@ namespace BansheeEditor
                 anythingModified = true;
             }
 
-            for (int i = 0; i < GetChildCount(); i++)
+            for (int i = 0; i < ChildCount; i++)
             {
                 InspectableField child = GetChild(i);
                 bool childModified = child.Refresh(0);
@@ -127,6 +158,7 @@ namespace BansheeEditor
             return anythingModified;
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -220,12 +252,20 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the expand/collapse toggle in the title bar.
+        /// </summary>
+        /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         private void OnFoldoutToggled(bool expanded)
         {
             isExpanded = expanded;
             forceUpdate = true;
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the resize button on the title bar. Changes the size of the array while
+        /// preserving existing contents.
+        /// </summary>
         private void OnResizeButtonClicked()
         {
             int size = guiSizeField.Value; // TODO - Support multi-rank arrays
@@ -241,6 +281,10 @@ namespace BansheeEditor
             property.SetValue(newArray);
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the delete button next to the array entry. Deletes an element in the array.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the array to remove.</param>
         private void OnDeleteButtonClicked(int index)
         {
             Array array = property.GetValue<Array>();
@@ -261,6 +305,11 @@ namespace BansheeEditor
             property.SetValue(newArray);
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the clone button next to the array entry. Clones an element in the array and
+        /// adds the clone to the back of the array.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the array to clone.</param>
         private void OnCloneButtonClicked(int index)
         {
             SerializableArray array = property.GetArray();
@@ -286,6 +335,11 @@ namespace BansheeEditor
             property.SetValue(newArray);
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the move up button next to the array entry. Moves an element from the current
+        /// array index to the one right before it, if not at zero.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the array to move.</param>
         private void OnMoveUpButtonClicked(int index)
         {
             Array array = property.GetValue<Array>();
@@ -299,6 +353,11 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the move down button next to the array entry. Moves an element from the current
+        /// array index to the one right after it, if the element isn't already the last element.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the array to move.</param>
         private void OnMoveDownButtonClicked(int index)
         {
             Array array = property.GetValue<Array>();
@@ -312,11 +371,19 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the create button on the title bar. Creates a brand new array with zero
+        /// elements in the place of the current array.
+        /// </summary>
         private void OnCreateButtonClicked()
         {
             property.SetValue(property.CreateArrayInstance(new int[1] { 0 }));
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the clear button on the title bar. Deletes the current array and sets
+        /// the reference to the array in the parent object to null.
+        /// </summary>
         private void OnClearButtonClicked()
         {
             property.SetValue<object>(null);

+ 21 - 0
MBansheeEditor/Inspector/InspectableBool.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a boolean. Boolean is displayed as a toggle button.
+    /// </summary>
     public class InspectableBool : InspectableField
     {
         private bool propertyValue;
         private GUIToggleField guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable boolean GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableBool(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Bool)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -56,6 +73,10 @@ namespace BansheeEditor
                 guiField.Value = propertyValue;
         }
 
+        /// <summary>
+        /// Triggered when the user toggles the toggle button.
+        /// </summary>
+        /// <param name="newValue">New value of the toggle button.</param>
         private void OnFieldValueChanged(bool newValue)
         {
             property.SetValue(newValue);

+ 22 - 0
MBansheeEditor/Inspector/InspectableColor.cs

@@ -7,18 +7,34 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a color. Color is displayed as a GUI color field that allows
+    /// the user to manipulate the color using a color picker.
+    /// </summary>
     public class InspectableColor : InspectableField
     {
         private Color propertyValue;
         private GUIColorField guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable color GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableColor(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Color)
@@ -32,6 +48,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +61,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -58,6 +76,10 @@ namespace BansheeEditor
                 guiField.Value = propertyValue;
         }
 
+        /// <summary>
+        /// Triggered when the user selects a new color.
+        /// </summary>
+        /// <param name="newValue">New value of the color field.</param>
         private void OnFieldValueChanged(Color newValue)
         {
             property.SetValue(newValue);

+ 73 - 3
MBansheeEditor/Inspector/InspectableField.cs

@@ -7,6 +7,12 @@ using BansheeEngine;
  
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Inspectable field displays GUI elements for a single <see cref="SerializableProperty"/>. This is a base class that
+    /// should be specialized for all supported types contained by <see cref="SerializableProperty"/>. Inspectable fields
+    /// can and should be created recursively - normally complex types like objects and arrays will contain fields of their 
+    /// own, while primitive types like integer or boolean will consist of only a GUI element.
+    /// </summary>
     public class InspectableField
     {
         private List<InspectableField> children = new List<InspectableField>();
@@ -17,6 +23,14 @@ namespace BansheeEditor
         protected string title;
         protected int depth;
 
+        /// <summary>
+        /// Creates a new inspectable field GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableField(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
         {
             this.layout = layout;
@@ -25,6 +39,10 @@ namespace BansheeEditor
             this.depth = depth;
         }
 
+        /// <summary>
+        /// Registers an inspectable field as a child of this field. 
+        /// </summary>
+        /// <param name="child">Inspectable field to register as a child.</param>
         protected void AddChild(InspectableField child)
         {
             if (child.parent == this)
@@ -37,12 +55,21 @@ namespace BansheeEditor
             child.parent = this;
         }
 
+        /// <summary>
+        /// Unregisters an inspectable field as a child of this field. Call this when manually destroying a child field.
+        /// </summary>
+        /// <param name="child">Inspectable field to unregister.</param>
         protected void RemoveChild(InspectableField child)
         {
             children.Remove(child);
             child.parent = null;
         }
 
+        /// <summary>
+        /// Checks if contents of the field have been modified, and updates them if needed.
+        /// </summary>
+        /// <param name="layoutIndex">Index in the parent's layout at which to insert the GUI elements for this field.</param>
+        /// <returns>True if there were any modifications in this field, or any child fields.</returns>
         public virtual bool Refresh(int layoutIndex)
         {
             bool anythingModified = false;
@@ -63,21 +90,40 @@ namespace BansheeEditor
             return anythingModified;
         }
 
+        /// <summary>
+        /// Returns the total number of GUI elements in the field's layout.
+        /// </summary>
+        /// <returns>Number of GUI elements in the field's layout.</returns>
         public int GetNumLayoutElements()
         {
-            return layout.GetNumElements();
+            return layout.NumElements;
         }
 
+        /// <summary>
+        /// Returns an optional title layout. Certain fields may contain separate title and content layouts. Parent fields
+        /// may use the separate title layout instead of the content layout to append elements. Having a separate title 
+        /// layout is purely cosmetical.
+        /// </summary>
+        /// <returns>Title layout if the field has one, null otherwise.</returns>
         public virtual GUILayoutX GetTitleLayout()
         {
             return null;
         }
 
+        /// <summary>
+        /// Checks have the values in the referenced serializable property have been changed compare to the value currently
+        /// displayed in the field.
+        /// </summary>
+        /// <returns>True if the value has been modified and needs updating.</returns>
         protected virtual bool IsModified()
         {
             return false;
         }
 
+        /// <summary>
+        /// Reconstructs the GUI by using the most up to date values from the referenced serializable property.
+        /// </summary>
+        /// <param name="layoutIndex">Index in the parent's layout at which to insert the GUI elements for this field.</param>
         protected virtual void Update(int layoutIndex)
         {
             // Destroy all children as we expect update to rebuild them
@@ -90,16 +136,27 @@ namespace BansheeEditor
             children.Clear();
         }
 
+        /// <summary>
+        /// Returns an inspectable field at the specified index.
+        /// </summary>
+        /// <param name="index">Sequential index of the field.</param>
+        /// <returns>Child inspectable field at the specified index.</returns>
         protected InspectableField GetChild(int index)
         {
             return children[index];
         }
 
-        protected int GetChildCount()
+        /// <summary>
+        /// Number of child inspectable fields.
+        /// </summary>
+        protected int ChildCount
         {
-            return children.Count;
+            get { return children.Count; }
         }
 
+        /// <summary>
+        /// Destroys all GUI elements in the inspectable field.
+        /// </summary>
         public virtual void Destroy()
         {
             layout.DestroyElements();
@@ -114,6 +171,19 @@ namespace BansheeEditor
                 parent.RemoveChild(this);
         }
 
+        /// <summary>
+        /// Creates a new inspectable field, automatically detecting the most appropriate implementation for the type
+        /// contained in the provided serializable property. This may be one of the built-in inspectable field implemetations
+        /// (like ones for primitives like int or bool), or a user defined implementation defined with a 
+        /// <see cref="CustomInspector"/> attribute.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
+        /// <returns>Inspectable field implementation that can be used for displaying the GUI for a serializable property
+        ///          of the provided type.</returns>
         public static InspectableField CreateInspectable(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
         {
             Type customInspectable = InspectorUtility.GetCustomInspectable(property.InternalType);

+ 33 - 4
MBansheeEditor/Inspector/InspectableFieldLayout.cs

@@ -1,30 +1,51 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Helper layout object that wraps a standard <see cref="GUILayout"/>, used primarily by <see cref="InspectableField"/>
+    /// implementations keep track of their own GUI elements in a layout.
+    /// </summary>
     public class InspectableFieldLayout
     {
         private GUILayoutY parentLayout;
         private List<GUIElement> elements = new List<GUIElement>();
 
+        /// <summary>
+        /// Creates a new inspectable field layout object.
+        /// </summary>
+        /// <param name="parentLayout">GUI layout object to wrap.</param>
         public InspectableFieldLayout(GUILayoutY parentLayout)
         {
             this.parentLayout = parentLayout;
         }
 
-        public int GetNumElements() { return elements.Count; }
+        /// <summary>
+        /// Number of child elements in the inspectable layout.
+        /// </summary>
+        public int NumElements
+        {
+            get { return elements.Count; }
+        }
 
+        /// <summary>
+        /// Adds a GUI element to the field layout.
+        /// </summary>
+        /// <param name="index">Index into the GUI layout at which the field layout start at.</param>
+        /// <param name="element">GUI element to insert into the layout.</param>
         public void AddElement(int index, GUIElement element)
         {
             parentLayout.InsertElement(index + elements.Count, element);
             elements.Add(element);
         }
 
+        /// <summary>
+        /// Creates a new <see cref="GUILayoutX"/> and adds it to the field layout.
+        /// </summary>
+        /// <param name="index">Index into the GUI layout at which the field layout start at.</param>
+        /// <returns>Newly created layout.</returns>
         public GUILayoutX AddLayoutX(int index)
         {
             GUILayoutX layout = parentLayout.InsertLayoutX(index + elements.Count);
@@ -33,6 +54,11 @@ namespace BansheeEditor
             return layout;
         }
 
+        /// <summary>
+        /// Creates a new <see cref="GUILayoutY"/> and adds it to the field layout.
+        /// </summary>
+        /// <param name="index">Index into the GUI layout at which the field layout start at.</param>
+        /// <returns>Newly created layout.</returns>
         public GUILayoutY AddLayoutY(int index)
         {
             GUILayoutY layout = parentLayout.InsertLayoutY(index + elements.Count);
@@ -41,6 +67,9 @@ namespace BansheeEditor
             return layout;
         }
 
+        /// <summary>
+        /// Destroys all GUI elements contained in the field layout. Leaves other elements present in GUI layout intact.
+        /// </summary>
         public void DestroyElements()
         {
             foreach (var element in elements)

+ 21 - 0
MBansheeEditor/Inspector/InspectableFloat.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a floating point value.
+    /// </summary>
     public class InspectableFloat : InspectableField
     {
         private float propertyValue;
         private GUIFloatField guiFloatField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable float GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableFloat(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Float)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user inputs a new floating point value.
+        /// </summary>
+        /// <param name="newValue">New value of the float field.</param>
         private void OnFieldValueChanged(float newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableGameObjectRef.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a <see cref="GameObject"/> reference.
+    /// </summary>
     public class InspectableGameObjectRef : InspectableField
     {
         private GameObject propertyValue;
         private GUIGameObjectField guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable game object reference GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableGameObjectRef(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.GameObjectRef)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -56,6 +73,10 @@ namespace BansheeEditor
                 guiField.Value = propertyValue;
         }
 
+        /// <summary>
+        /// Triggered when the user drops a new game object onto the field, or clears the current value.
+        /// </summary>
+        /// <param name="newValue">New game object to reference.</param>
         private void OnFieldValueChanged(GameObject newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableInt.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing an integer value.
+    /// </summary>
     public class InspectableInt : InspectableField
     {
         private int propertyValue;
         private GUIIntField guiIntField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable integer GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableInt(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Int)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user inputs a new integer value.
+        /// </summary>
+        /// <param name="newValue">New value of the int field.</param>
         private void OnFieldValueChanged(int newValue)
         {
             property.SetValue(newValue);

+ 68 - 1
MBansheeEditor/Inspector/InspectableList.cs

@@ -7,8 +7,15 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a list. List contents are displayed as rows of entries 
+    /// that can be shown, hidden or manipulated.
+    /// </summary>
     public class InspectableList : InspectableField
     {
+        /// <summary>
+        /// Contains GUI elements for a single entry in the list.
+        /// </summary>
         private class EntryRow
         {
             public GUILayoutY contentLayout;
@@ -16,12 +23,22 @@ namespace BansheeEditor
             private GUILayoutX titleLayout;
             private bool ownsTitleLayout;
 
+            /// <summary>
+            /// Constructs a new entry row object.
+            /// </summary>
+            /// <param name="parentLayout">Parent layout that row GUI elements will be added to.</param>
             public EntryRow(GUILayout parentLayout)
             {
                 rowLayout = parentLayout.AddLayoutX();
                 contentLayout = rowLayout.AddLayoutY();
             }
 
+            /// <summary>
+            /// Recreates all row GUI elements.
+            /// </summary>
+            /// <param name="child">Inspectable field of the list entry.</param>
+            /// <param name="seqIndex">Sequential index of the list entry.</param>
+            /// <param name="parent">Parent list object that the entry is contained in.</param>
             public void Refresh(InspectableField child, int seqIndex, InspectableList parent)
             {
                 if (ownsTitleLayout || (titleLayout != null && titleLayout == child.GetTitleLayout()))
@@ -54,6 +71,9 @@ namespace BansheeEditor
                 titleLayout.AddElement(moveDownBtn);
             }
 
+            /// <summary>
+            /// Destroys all row GUI elements.
+            /// </summary>
             public void Destroy()
             {
                 rowLayout.Destroy();
@@ -73,17 +93,27 @@ namespace BansheeEditor
         private bool forceUpdate = true;
         private bool isExpanded;
 
+        /// <summary>
+        /// Creates a new inspectable list GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field.Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableList(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <inheritdoc/>
         public override GUILayoutX GetTitleLayout()
         {
             return guiTitleLayout;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (forceUpdate)
@@ -103,6 +133,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         public override bool Refresh(int layoutIndex)
         {
             bool anythingModified = false;
@@ -113,7 +144,7 @@ namespace BansheeEditor
                 anythingModified = true;
             }
 
-            for (int i = 0; i < GetChildCount(); i++)
+            for (int i = 0; i < ChildCount; i++)
             {
                 InspectableField child = GetChild(i);
                 bool childModified = child.Refresh(0);
@@ -127,6 +158,7 @@ namespace BansheeEditor
             return anythingModified;
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -220,12 +252,20 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the expand/collapse toggle in the title bar.
+        /// </summary>
+        /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         private void OnFoldoutToggled(bool expanded)
         {
             isExpanded = expanded;
             forceUpdate = true;
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the resize button on the title bar. Changes the size of the list while
+        /// preserving existing contents.
+        /// </summary>
         private void OnResizeButtonClicked()
         {
             int size = guiSizeField.Value;
@@ -240,6 +280,10 @@ namespace BansheeEditor
             property.SetValue(newList);
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the delete button next to the list entry. Deletes an element in the list.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the list to remove.</param>
         private void OnDeleteButtonClicked(int index)
         {
             IList list = property.GetValue<IList>();
@@ -248,6 +292,11 @@ namespace BansheeEditor
                 list.RemoveAt(index);
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the clone button next to the list entry. Clones an element in the list and
+        /// adds the clone to the back of the list.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the list to clone.</param>
         private void OnCloneButtonClicked(int index)
         {
             SerializableList serializableList = property.GetList();
@@ -261,6 +310,11 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the move up button next to the list entry. Moves an element from the current
+        /// list index to the one right before it, if not at zero.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the list to move.</param>
         private void OnMoveUpButtonClicked(int index)
         {
             IList list = property.GetValue<IList>();
@@ -274,6 +328,11 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the move down button next to the list entry. Moves an element from the current
+        /// list index to the one right after it, if the element isn't already the last element.
+        /// </summary>
+        /// <param name="index">Sequential index of the element in the list to move.</param>
         private void OnMoveDownButtonClicked(int index)
         {
             IList list = property.GetValue<IList>();
@@ -287,11 +346,19 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the create button on the title bar. Creates a brand new list with zero
+        /// elements in the place of the current list.
+        /// </summary>
         private void OnCreateButtonClicked()
         {
             property.SetValue(property.CreateListInstance(0));
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the clear button on the title bar. Deletes the current list and sets
+        /// the reference to the list in the parent object to null.
+        /// </summary>
         private void OnClearButtonClicked()
         {
             property.SetValue<object>(null);

+ 27 - 0
MBansheeEditor/Inspector/InspectableObject.cs

@@ -7,6 +7,10 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a generic object. Inspectable object fields are displayed
+    /// in separate rows.
+    /// </summary>
     public class InspectableObject : InspectableField
     {
         private const int IndentAmount = 5;
@@ -18,17 +22,27 @@ namespace BansheeEditor
         private bool isExpanded;
         private bool forceUpdate = true;
 
+        /// <summary>
+        /// Creates a new inspectable array GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field.Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableObject(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
             
         }
 
+        /// <inheritdoc/>
         public override GUILayoutX GetTitleLayout()
         {
             return guiTitleLayout;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (forceUpdate)
@@ -44,6 +58,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int index)
         {
             base.Update(index);
@@ -119,17 +134,29 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the expand/collapse toggle in the title bar.
+        /// </summary>
+        /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         private void OnFoldoutToggled(bool expanded)
         {
             isExpanded = expanded;
             forceUpdate = true;
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the create button on the title bar. Creates a brand new object with default
+        /// values in the place of the current array.
+        /// </summary>
         private void OnCreateButtonClicked()
         {
             property.SetValue(property.CreateObjectInstance<object>());
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the clear button on the title bar. Deletes the current object and sets
+        /// the reference to the object in the parent object to null. This is only relevant for objects of reference types.
+        /// </summary>
         private void OnClearButtonClicked()
         {
             property.SetValue<object>(null);

+ 21 - 0
MBansheeEditor/Inspector/InspectableResourceRef.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a <see cref="Resource"/> reference.
+    /// </summary>
     public class InspectableResourceRef : InspectableField
     {
         private Resource propertyValue;
         private GUIResourceField guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable resource reference GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableResourceRef(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.ResourceRef)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -56,6 +73,10 @@ namespace BansheeEditor
                 guiField.Value = propertyValue;
         }
 
+        /// <summary>
+        /// Triggered when the user drops a new resource onto the field, or clears the current value.
+        /// </summary>
+        /// <param name="newValue">New resource to reference.</param>
         private void OnFieldValueChanged(Resource newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableString.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a string.
+    /// </summary>
     public class InspectableString : InspectableField
     {
         private string propertyValue;
         private GUITextField guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable string GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableString(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.String)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user inputs a new string.
+        /// </summary>
+        /// <param name="newValue">New value of the string field.</param>
         private void OnFieldValueChanged(string newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableVector2.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a 2D vector.
+    /// </summary>
     public class InspectableVector2 : InspectableField
     {
         private Vector2 propertyValue;
         private GUIVector2Field guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable 2D vector GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableVector2(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Vector2)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user changes the field value.
+        /// </summary>
+        /// <param name="newValue">New value of the 2D vector field.</param>
         private void OnFieldValueChanged(Vector2 newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableVector3.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a 3D vector.
+    /// </summary>
     public class InspectableVector3 : InspectableField
     {
         private Vector3 propertyValue;
         private GUIVector3Field guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable 3D vector GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableVector3(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Vector3)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user changes the field value.
+        /// </summary>
+        /// <param name="newValue">New value of the 3D vector field.</param>
         private void OnFieldValueChanged(Vector3 newValue)
         {
             property.SetValue(newValue);

+ 21 - 0
MBansheeEditor/Inspector/InspectableVector4.cs

@@ -7,18 +7,33 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a serializable property containing a 4D vector.
+    /// </summary>
     public class InspectableVector4 : InspectableField
     {
         private Vector4 propertyValue;
         private GUIVector4Field guiField;
         private bool isInitialized;
 
+        /// <summary>
+        /// Creates a new inspectable 4D vector GUI for the specified property.
+        /// </summary>
+        /// <param name="title">Name of the property, or some other value to set as the title.</param>
+        /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
+        ///                     contain other fields, in which case you should increase this value by one.</param>
+        /// <param name="layout">Parent layout that all the field elements will be added to.</param>
+        /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         public InspectableVector4(string title, int depth, InspectableFieldLayout layout, SerializableProperty property)
             : base(title, depth, layout, property)
         {
 
         }
 
+        /// <summary>
+        /// Initializes the GUI elements the first time <see cref="Update"/> gets called.
+        /// </summary>
+        /// <param name="layoutIndex">Index at which to insert the GUI elements.</param>
         private void Initialize(int layoutIndex)
         {
             if (property.Type == SerializableProperty.FieldType.Vector4)
@@ -32,6 +47,7 @@ namespace BansheeEditor
             isInitialized = true;
         }
 
+        /// <inheritdoc/>
         protected override bool IsModified()
         {
             if (!isInitialized)
@@ -44,6 +60,7 @@ namespace BansheeEditor
             return base.IsModified();
         }
 
+        /// <inheritdoc/>
         protected override void Update(int layoutIndex)
         {
             base.Update(layoutIndex);
@@ -61,6 +78,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user changes the field value.
+        /// </summary>
+        /// <param name="newValue">New value of the 3D vector field.</param>
         private void OnFieldValueChanged(Vector4 newValue)
         {
             property.SetValue(newValue);

+ 20 - 1
MBansheeEditor/Inspector/Inspector.cs

@@ -6,6 +6,9 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI elements for all the inspectable fields in an object.
+    /// </summary>
     public abstract class Inspector
     {
         public const short START_BACKGROUND_DEPTH = 50;
@@ -16,6 +19,12 @@ namespace BansheeEditor
 
         private InspectorWindow parentWindow;
 
+        /// <summary>
+        /// Initializes the inspector. Must be called after construction.
+        /// </summary>
+        /// <param name="parentWindow">Parent window to render the GUI to.</param>
+        /// <param name="gui">GUI panel to add the GUI elements to.</param>
+        /// <param name="instance">Instance of the object whose fields to display GUI for.</param>
         internal virtual void Initialize(InspectorWindow parentWindow, GUIPanel gui, object instance)
         {
             GUI = gui;
@@ -24,18 +33,28 @@ namespace BansheeEditor
             this.parentWindow = parentWindow;
         }
 
+        /// <summary>
+        /// Hides or shows the inspector GUI elements.
+        /// </summary>
+        /// <param name="visible">True to make the GUI elements visible.</param>
         internal virtual void SetVisible(bool visible)
         {
             GUI.Visible = visible;
         }
 
+        /// <summary>
+        /// Destroys all inspector GUI elements.
+        /// </summary>
         internal void Destroy()
         {
             layout.Destroy();
             GUI.Destroy();
         }
 
+        /// <summary>
+        /// Checks if contents of the inspector have been modified, and updates them if needed.
+        /// </summary>
+        /// <returns>True if there were any modifications, false otherwise.</returns>
         internal abstract bool Refresh();
-        internal abstract int GetOptimalHeight();
     }
 }

+ 15 - 0
MBansheeEditor/Inspector/InspectorUtility.cs

@@ -8,8 +8,16 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Contains utility methods relating to inspector window.
+    /// </summary>
     public class InspectorUtility
     {
+        /// <summary>
+        /// Creates an inspector capable of displaying GUI elements for an object of the provided type.
+        /// </summary>
+        /// <param name="type">Type of the object that will be displayed in the inspector.</param>
+        /// <returns>Custom user defined inspector if it exists for the provided type, or the generic inspector.</returns>
         public static Inspector GetInspector(Type type)
         {
             Inspector customInspector = Internal_GetCustomInspector(type);
@@ -19,6 +27,13 @@ namespace BansheeEditor
             return new GenericInspector();
         }
 
+        /// <summary>
+        /// Gets an <see cref="InspectableField"/> implementation for the specified type. This only searches custom user
+        /// defined implementations, not the built-in ones.
+        /// </summary>
+        /// <param name="type">Type of the object to find an <see cref="InspectableField"/> for.</param>
+        /// <returns>Implementation of <see cref="InspectableField"/> capable of display contents of the provided type,
+        ///          or null if one wasn't found.</returns>
         public static Type GetCustomInspectable(Type type)
         {
             Type customInspectable = Internal_GetCustomInspectable(type);

+ 84 - 11
MBansheeEditor/Inspector/InspectorWindow.cs

@@ -6,8 +6,15 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Displays GUI for a <see cref="SceneObject"/> or for a <see cref="Resource"/>. Scene object's transform values
+    /// are displayed, along with all their components and their fields.
+    /// </summary>
     internal sealed class InspectorWindow : EditorWindow
     {
+        /// <summary>
+        /// Type of objects displayed in the window.
+        /// </summary>
         private enum InspectorType
         {
             SceneObject,
@@ -16,6 +23,9 @@ namespace BansheeEditor
             None
         }
 
+        /// <summary>
+        /// Inspector GUI elements for a single <see cref="Component"/> in a <see cref="SceneObject"/>.
+        /// </summary>
         private class InspectorComponent
         {
             public GUIToggle foldout;
@@ -26,6 +36,9 @@ namespace BansheeEditor
             public UInt64 instanceId;
         }
 
+        /// <summary>
+        /// Inspector GUI elements for a <see cref="Resource"/>
+        /// </summary>
         private class InspectorResource
         {
             public GUIPanel panel;
@@ -62,17 +75,28 @@ namespace BansheeEditor
         private InspectorType currentType = InspectorType.None;
         private Resource activeResource;
 
+        /// <summary>
+        /// Opens the inspector window from the menu bar.
+        /// </summary>
         [MenuItem("Windows/Inspector", ButtonModifier.CtrlAlt, ButtonCode.I)]
         private static void OpenInspectorWindow()
         {
             OpenWindow<InspectorWindow>();
         }
 
+        /// <summary>
+        /// Name of the inspector window to display on the window title.
+        /// </summary>
+        /// <returns>Name of the inspector window to display on the window title.</returns>
         protected override LocString GetDisplayName()
         {
             return new LocEdString("Inspector");
         }
 
+        /// <summary>
+        /// Sets a resource whose GUI is to be displayed in the inspector. Clears any previous contents of the window.
+        /// </summary>
+        /// <param name="resourcePath">Resource path relative to the project of the resource to inspect.</param>
         private void SetObjectToInspect(String resourcePath)
         {
             activeResource = ProjectLibrary.Load<Resource>(resourcePath);
@@ -96,6 +120,10 @@ namespace BansheeEditor
             inspectorLayout.AddFlexibleSpace();
         }
 
+        /// <summary>
+        /// Sets a scene object whose GUI is to be displayed in the inspector. Clears any previous contents of the window.
+        /// </summary>
+        /// <param name="so">Scene object to inspect.</param>
         private void SetObjectToInspect(SceneObject so)
         {
             if (so == null)
@@ -153,12 +181,11 @@ namespace BansheeEditor
             titleBg.Bounds = GetTitleBounds();
         }
 
-        private void OnComponentFoldoutToggled(InspectorComponent inspectorData, bool expanded)
-        {
-            inspectorData.expanded = expanded;
-            inspectorData.inspector.SetVisible(expanded);
-        }
-
+        /// <summary>
+        /// Creates GUI elements required for displaying <see cref="SceneObject"/> fields like name, prefab data and 
+        /// transform (position, rotation, scale). Assumes that necessary inspector scroll area layout has already been 
+        /// created.
+        /// </summary>
         private void CreateSceneObjectFields()
         {
             GUIPanel sceneObjectPanel = inspectorLayout.AddPanel();
@@ -249,6 +276,11 @@ namespace BansheeEditor
             sceneObjectBgPanel.AddElement(titleBg);
         }
 
+        /// <summary>
+        /// Updates contents of the scene object specific fields (name, position, rotation, etc.)
+        /// </summary>
+        /// <param name="forceUpdate">If true, the GUI elements will be updated regardless of whether a change was
+        ///                           detected or not.</param>
         private void RefreshSceneObjectFields(bool forceUpdate)
         {
             if (activeSO == null)
@@ -431,6 +463,11 @@ namespace BansheeEditor
                 scrollAreaHighlight.Visible = isDraggingOver;
         }
 
+        /// <summary>
+        /// Triggered when the user selects a new resource or a scene object, or deselects everything.
+        /// </summary>
+        /// <param name="objects">A set of new scene objects that were selected.</param>
+        /// <param name="paths">A set of absolute resource paths that were selected.</param>
         private void OnSelectionChanged(SceneObject[] objects, string[] paths)
         {
             Clear();
@@ -473,6 +510,21 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user closes or expands a component foldout, making the component fields visible or hidden.
+        /// </summary>
+        /// <param name="inspectorData">Contains GUI data for the component that was toggled.</param>
+        /// <param name="expanded">Determines whether to display or hide component contents.</param>
+        private void OnComponentFoldoutToggled(InspectorComponent inspectorData, bool expanded)
+        {
+            inspectorData.expanded = expanded;
+            inspectorData.inspector.SetVisible(expanded);
+        }
+
+        /// <summary>
+        /// Triggered when the user clicks the component remove button. Removes that component from the active scene object.
+        /// </summary>
+        /// <param name="componentType">Type of the component to remove.</param>
         private void OnComponentRemoveClicked(Type componentType)
         {
             if (activeSO != null)
@@ -482,11 +534,9 @@ namespace BansheeEditor
             }
         }
 
-        internal void Destroy()
-        {
-            Clear();
-        }
-
+        /// <summary>
+        /// Destroys all inspector GUI elements.
+        /// </summary>
         internal void Clear()
         {
             for (int i = 0; i < inspectorComponents.Count; i++)
@@ -543,11 +593,21 @@ namespace BansheeEditor
             currentType = InspectorType.None;
         }
 
+        /// <summary>
+        /// Returns the size of the title bar area that is displayed for <see cref="SceneObject"/> specific fields.
+        /// </summary>
+        /// <returns>Area of the title bar, relative to the window.</returns>
         private Rect2I GetTitleBounds()
         {
             return new Rect2I(0, 0, Width, 115);
         }
 
+        /// <summary>
+        /// Triggered when the position value in the currently active <see cref="SceneObject"/> changes. Updates the 
+        /// necessary GUI elements.
+        /// </summary>
+        /// <param name="idx">Index of the coordinate that was changed.</param>
+        /// <param name="value">New value of the field.</param>
         private void OnPositionChanged(int idx, float value)
         {
             if (activeSO == null)
@@ -567,6 +627,12 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the rotation value in the currently active <see cref="SceneObject"/> changes. Updates the 
+        /// necessary GUI elements.
+        /// </summary>
+        /// <param name="idx">Index of the euler angle that was changed (0 - X, 1 - Y, 2 - Z).</param>
+        /// <param name="value">New value of the field.</param>
         private void OnRotationChanged(int idx, float value)
         {
             if (activeSO == null)
@@ -586,6 +652,12 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the scale value in the currently active <see cref="SceneObject"/> changes. Updates the 
+        /// necessary GUI elements.
+        /// </summary>
+        /// <param name="idx">Index of the coordinate that was changed.</param>
+        /// <param name="value">New value of the field.</param>
         private void OnScaleChanged(int idx, float value)
         {
             if (activeSO == null)
@@ -596,6 +668,7 @@ namespace BansheeEditor
             activeSO.LocalScale = scale;
         }
 
+        /// <inheritdoc/>
         protected override void WindowResized(int width, int height)
         {
             base.WindowResized(width, height);

+ 0 - 1
MBansheeEditor/MBansheeEditor.csproj

@@ -43,7 +43,6 @@
     <Compile Include="BuildManager.cs" />
     <Compile Include="CodeEditor.cs" />
     <Compile Include="ColorPicker.cs" />
-    <Compile Include="DbgCustomInspector.cs" />
     <Compile Include="DbgEditorWindow.cs" />
     <Compile Include="DbgGizmo.cs" />
     <Compile Include="DbgGizmoComponent.cs" />

+ 1 - 0
TODO.txt

@@ -53,6 +53,7 @@ Code quality improvements:
 Polish
 
 Ribek use:
+ - Opening complex array entries causes inspector to get screwed up
  - Hook up color picker to guicolor field
  - Camera, Renderable, Material, Texture inspector
  - Test release mode