BearishSun 10 лет назад
Родитель
Сommit
91148fd66b

+ 1 - 1
BansheeEngine/Include/BsSpriteTexture.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 {
 {
 	/**
 	/**
 	 * @brief	Texture interface that encapsulates underlying texture which allows us
 	 * @brief	Texture interface that encapsulates underlying texture which allows us
-	 * 			to create a sprite texture atlas (e.g. multiple SpriteTextures referencing
+	 * 			to create a sprite texture atlas (e.g. multiple SpriteTexture%s referencing
 	 *			different parts of a single Texture).
 	 *			different parts of a single Texture).
 	 */
 	 */
 	class BS_EXPORT SpriteTexture : public Resource
 	class BS_EXPORT SpriteTexture : public Resource

+ 1 - 1
MBansheeEditor/Inspector/GenericInspector.cs

@@ -18,7 +18,7 @@ namespace BansheeEditor
             {
             {
                 SerializableObject serializableObject = new SerializableObject(referencedObject.GetType(), referencedObject);
                 SerializableObject serializableObject = new SerializableObject(referencedObject.GetType(), referencedObject);
 
 
-                foreach (var field in serializableObject.fields)
+                foreach (var field in serializableObject.Fields)
                 {
                 {
                     if (!field.Inspectable)
                     if (!field.Inspectable)
                         continue;
                         continue;

+ 1 - 1
MBansheeEditor/Inspector/InspectableObject.cs

@@ -94,7 +94,7 @@ namespace BansheeEditor
                     GUILayoutY guiContentLayout = guiChildLayout.AddLayoutY();
                     GUILayoutY guiContentLayout = guiChildLayout.AddLayoutY();
 
 
                     SerializableObject serializableObject = property.GetObject();
                     SerializableObject serializableObject = property.GetObject();
-                    foreach (var field in serializableObject.fields)
+                    foreach (var field in serializableObject.Fields)
                     {
                     {
                         if (!field.Inspectable)
                         if (!field.Inspectable)
                             continue;
                             continue;

+ 5 - 5
MBansheeEditor/UnitTests.cs

@@ -86,18 +86,18 @@ namespace BansheeEditor
         {
         {
             SerializableObject obj = new SerializableObject(typeof(UT1_SerzCls), new UT1_SerzCls());
             SerializableObject obj = new SerializableObject(typeof(UT1_SerzCls), new UT1_SerzCls());
 
 
-            Debug.Log(obj.fields.Length);
-            for (int i = 0; i < obj.fields.Length; i++)
+            Debug.Log(obj.Fields.Length);
+            for (int i = 0; i < obj.Fields.Length; i++)
             {
             {
-                Debug.Log(i + ". " + obj.fields[i].Name + " - " + obj.fields[i].Type.ToString());
+                Debug.Log(i + ". " + obj.Fields[i].Name + " - " + obj.Fields[i].Type.ToString());
             }
             }
 
 
-            SerializableProperty prop = obj.fields[0].GetProperty();
+            SerializableProperty prop = obj.Fields[0].GetProperty();
             Debug.Log("Old value: " + prop.GetValue<int>());
             Debug.Log("Old value: " + prop.GetValue<int>());
             prop.SetValue<int>(33);
             prop.SetValue<int>(33);
             Debug.Log("New value: " + prop.GetValue<int>());
             Debug.Log("New value: " + prop.GetValue<int>());
 
 
-            SerializableProperty prop2 = obj.fields[2].GetProperty();
+            SerializableProperty prop2 = obj.Fields[2].GetProperty();
             Debug.Log("Old value: " + (prop2.GetValue<UT1_SerzCls>() == null));
             Debug.Log("Old value: " + (prop2.GetValue<UT1_SerzCls>() == null));
 
 
             UT1_SerzCls child = new UT1_SerzCls();
             UT1_SerzCls child = new UT1_SerzCls();

+ 2 - 2
MBansheeEngine/SerializableArray.cs

@@ -26,7 +26,7 @@ namespace BansheeEngine
         /// Constructor for use by the runtime only.
         /// Constructor for use by the runtime only.
         /// </summary>
         /// </summary>
         /// <param name="internalElementType">C# type of the elements in the array.</param>
         /// <param name="internalElementType">C# type of the elements in the array.</param>
-        /// <param name="parentProperty">Property this array belongs to.</param>
+        /// <param name="parentProperty">Property used for retrieving this entry.</param>
         private SerializableArray(Type internalElementType, SerializableProperty parentProperty)
         private SerializableArray(Type internalElementType, SerializableProperty parentProperty)
         {
         {
             this.parentProperty = parentProperty;
             this.parentProperty = parentProperty;
@@ -38,7 +38,7 @@ namespace BansheeEngine
         /// Returns a serializable property for a specific array element.
         /// Returns a serializable property for a specific array element.
         /// </summary>
         /// </summary>
         /// <param name="elementIdx">Index of the element in the array.</param>
         /// <param name="elementIdx">Index of the element in the array.</param>
-        /// <returns>Serializable property for the element that may be used for querying element meta-data.</returns>
+        /// <returns>Serializable property that allows you to manipulate contents of the array entry.</returns>
         public SerializableProperty GetProperty(int elementIdx)
         public SerializableProperty GetProperty(int elementIdx)
         {
         {
             SerializableProperty.Getter getter = () =>
             SerializableProperty.Getter getter = () =>

+ 3 - 3
MBansheeEngine/SerializableDictionary.cs

@@ -40,7 +40,7 @@ namespace BansheeEngine
         /// </summary>
         /// </summary>
         /// <param name="internalKeyType">C# type of the keys in the dictionary.</param>
         /// <param name="internalKeyType">C# type of the keys in the dictionary.</param>
         /// <param name="internalValueType">C# type of the values in the dictionary.</param>
         /// <param name="internalValueType">C# type of the values in the dictionary.</param>
-        /// <param name="parentProperty">Property this dictionary belongs to.</param>
+        /// <param name="parentProperty">Property used for retrieving this entry.</param>
         private SerializableDictionary(Type internalKeyType, Type internalValueType, SerializableProperty parentProperty)
         private SerializableDictionary(Type internalKeyType, Type internalValueType, SerializableProperty parentProperty)
         {
         {
             this.parentProperty = parentProperty;
             this.parentProperty = parentProperty;
@@ -51,10 +51,10 @@ namespace BansheeEngine
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Returns a property that can be used for retrieving meta-data about a value in the dictionary.
+        /// Returns a serializable property for the specified entry.
         /// </summary>
         /// </summary>
         /// <param name="key">Dictionary key for the value to retrieve.</param>
         /// <param name="key">Dictionary key for the value to retrieve.</param>
-        /// <returns>Serializable property for the element that may be used for querying element meta-data.</returns>
+        /// <returns>Serializable property that allows you to manipulate contents of the dictionary entry.</returns>
         public KeyValuePair<SerializableProperty, SerializableProperty> GetProperty(object key)
         public KeyValuePair<SerializableProperty, SerializableProperty> GetProperty(object key)
         {
         {
             IDictionary dictionary = parentProperty.GetValue<IDictionary>();
             IDictionary dictionary = parentProperty.GetValue<IDictionary>();

+ 33 - 1
MBansheeEngine/SerializableField.cs

@@ -6,6 +6,9 @@ using System.Text;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Allows you to access meta-data about field in an object. Similar to Reflection but simpler and faster.
+    /// </summary>
     public class SerializableField : ScriptObject
     public class SerializableField : ScriptObject
     {
     {
         private SerializableObject parent;
         private SerializableObject parent;
@@ -14,7 +17,13 @@ namespace BansheeEngine
         private Type internalType;
         private Type internalType;
         private string name;
         private string name;
 
 
-        // Only constructed from native code
+        /// <summary>
+        /// Constructor for internal use by the runtime.
+        /// </summary>
+        /// <param name="parent">Object that conains the field.</param>
+        /// <param name="name">Name of the field.</param>
+        /// <param name="flags">Flags that control whether the field is inspectable or serializable.</param>
+        /// <param name="internalType">Internal C# type of the field.</param>
         private SerializableField(SerializableObject parent, string name, int flags, Type internalType)
         private SerializableField(SerializableObject parent, string name, int flags, Type internalType)
         {
         {
             this.parent = parent;
             this.parent = parent;
@@ -24,36 +33,59 @@ namespace BansheeEngine
             this.internalType = internalType;
             this.internalType = internalType;
         }
         }
 
 
+        /// <summary>
+        /// Returns the type of data contained in the field.
+        /// </summary>
         public SerializableProperty.FieldType Type
         public SerializableProperty.FieldType Type
         {
         {
             get { return type; }
             get { return type; }
         }
         }
 
 
+        /// <summary>
+        /// Returns true if the field has custom inspector GUI.
+        /// </summary>
         public bool HasCustomInspector
         public bool HasCustomInspector
         {
         {
             get { return false; } // TODO - Add [UseCustomInspector(typeof(InspecableType))] attribute and parse it
             get { return false; } // TODO - Add [UseCustomInspector(typeof(InspecableType))] attribute and parse it
         }
         }
 
 
+        /// <summary>
+        /// Returns a type deriving from Inspector, that is used for displaying the custom inspector for this element.
+        /// Only relevant if <see cref="HasCustomInspector"/> is true.
+        /// </summary>
         public Type CustomInspectorType
         public Type CustomInspectorType
         {
         {
             get { return null; } // TODO - See above. Return type from UseCustomInspector attribute
             get { return null; } // TODO - See above. Return type from UseCustomInspector attribute
         }
         }
 
 
+        /// <summary>
+        /// Returns the name of the field.
+        /// </summary>
         public string Name
         public string Name
         {
         {
             get { return name; }
             get { return name; }
         }
         }
 
 
+        /// <summary>
+        /// Returns true if the field will be visible in the default inspector.
+        /// </summary>
         public bool Inspectable
         public bool Inspectable
         {
         {
             get { return (flags & 0x02) != 0; } // Flags as defined in native code in BsManagedSerializableObjectInfo.h
             get { return (flags & 0x02) != 0; } // Flags as defined in native code in BsManagedSerializableObjectInfo.h
         }
         }
 
 
+        /// <summary>
+        /// Returns true if the field will be automatically serialized.
+        /// </summary>
         public bool Serializable
         public bool Serializable
         {
         {
             get { return (flags & 0x01) != 0; } // Flags as defined in native code in BsManagedSerializableObjectInfo.h
             get { return (flags & 0x01) != 0; } // Flags as defined in native code in BsManagedSerializableObjectInfo.h
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable property for the field. 
+        /// </summary>
+        /// <returns>Serializable property that allows you to manipulate contents of the field.</returns>
         public SerializableProperty GetProperty()
         public SerializableProperty GetProperty()
         {
         {
             SerializableProperty.Getter getter = () =>
             SerializableProperty.Getter getter = () =>

+ 21 - 1
MBansheeEngine/SerializableList.cs

@@ -5,18 +5,29 @@ using System.Runtime.CompilerServices;
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 #pragma warning disable 649
 #pragma warning disable 649
+
+    /// <summary>
+    /// Allows you to access meta-data about a managed list and its children. Similar to Reflection but simpler and faster.
+    /// </summary>
     public sealed class SerializableList : ScriptObject
     public sealed class SerializableList : ScriptObject
     {
     {
         private SerializableProperty.FieldType elementType;
         private SerializableProperty.FieldType elementType;
         private Type internalElementType;
         private Type internalElementType;
         private SerializableProperty parentProperty;
         private SerializableProperty parentProperty;
 
 
+        /// <summary>
+        /// Type of elements stored in the list.
+        /// </summary>
         public SerializableProperty.FieldType ElementType
         public SerializableProperty.FieldType ElementType
         {
         {
             get { return elementType; }
             get { return elementType; }
         }
         }
 
 
-        // Constructed from native code
+        /// <summary>
+        /// Constructor for use by the runtime only.
+        /// </summary>
+        /// <param name="internalElementType">C# type of the elements in the list.</param>
+        /// <param name="parentProperty">Property used for retrieving this entry.</param>
         private SerializableList(Type internalElementType, SerializableProperty parentProperty)
         private SerializableList(Type internalElementType, SerializableProperty parentProperty)
         {
         {
             this.parentProperty = parentProperty;
             this.parentProperty = parentProperty;
@@ -24,6 +35,11 @@ namespace BansheeEngine
             elementType = SerializableProperty.DetermineFieldType(internalElementType);
             elementType = SerializableProperty.DetermineFieldType(internalElementType);
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable property for a specific list element.
+        /// </summary>
+        /// <param name="elementIdx">Index of the element in the list.</param>
+        /// <returns>Serializable property that allows you to manipulate contents of the list entry.</returns>
         public SerializableProperty GetProperty(int elementIdx)
         public SerializableProperty GetProperty(int elementIdx)
         {
         {
             SerializableProperty.Getter getter = () =>
             SerializableProperty.Getter getter = () =>
@@ -50,6 +66,10 @@ namespace BansheeEngine
             return property;
             return property;
         }
         }
 
 
+        /// <summary>
+        /// Returns number of elements in the list.
+        /// </summary>
+        /// <returns>Number of elements in the list.</returns>
         public int GetLength()
         public int GetLength()
         {
         {
             IList list = parentProperty.GetValue<IList>();
             IList list = parentProperty.GetValue<IList>();

+ 22 - 2
MBansheeEngine/SerializableObject.cs

@@ -8,13 +8,21 @@ using System.Threading.Tasks;
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
     #pragma warning disable 649
     #pragma warning disable 649
+
+    /// <summary>
+    /// Allows you to access meta-data about a managed object and its fields. Similar to Reflection but simpler and faster.
+    /// </summary>
     public sealed class SerializableObject : ScriptObject
     public sealed class SerializableObject : ScriptObject
     {
     {
         internal SerializableProperty parentProperty;
         internal SerializableProperty parentProperty;
         internal object parentObject;
         internal object parentObject;
         private SerializableField[] _fields;
         private SerializableField[] _fields;
 
 
-        // Note: Also called from native code
+        /// <summary>
+        /// Creates a new serializable object for the specified object type.
+        /// </summary>
+        /// <param name="objectType">C# type of the object.</param>
+        /// <param name="parentProperty">Property used for retrieving this entry.</param>
         public SerializableObject(Type objectType, SerializableProperty parentProperty)
         public SerializableObject(Type objectType, SerializableProperty parentProperty)
         {
         {
             Internal_CreateInstance(this, objectType);
             Internal_CreateInstance(this, objectType);
@@ -23,6 +31,11 @@ namespace BansheeEngine
             this.parentObject = null;
             this.parentObject = null;
         }
         }
 
 
+        /// <summary>
+        /// Creates a new serializable object for the specified object type.
+        /// </summary>
+        /// <param name="objectType">C# type of the object.</param>
+        /// <param name="parentObject">Specific instance of the object of <paramref name="objectType"/></param>
         public SerializableObject(Type objectType, object parentObject)
         public SerializableObject(Type objectType, object parentObject)
         {
         {
             Internal_CreateInstance(this, objectType);
             Internal_CreateInstance(this, objectType);
@@ -31,11 +44,18 @@ namespace BansheeEngine
             this.parentObject = parentObject;
             this.parentObject = parentObject;
         }
         }
 
 
-        public SerializableField[] fields
+        /// <summary>
+        /// Returns all fields in the object.
+        /// </summary>
+        public SerializableField[] Fields
         {
         {
             get { return _fields; }
             get { return _fields; }
         }
         }
 
 
+        /// <summary>
+        /// Returns the specific object instance this object is operating on.
+        /// </summary>
+        /// <returns>Object instance.</returns>
         public object GetReferencedObject()
         public object GetReferencedObject()
         {
         {
             if (parentProperty != null)
             if (parentProperty != null)

+ 90 - 1
MBansheeEngine/SerializableProperty.cs

@@ -7,8 +7,15 @@ using System.Text;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Allows you to transparently retrieve and set values of an entry, whether that entry is an object field or 
+    /// an array/list/dictionary entry.
+    /// </summary>
     public sealed class SerializableProperty : ScriptObject
     public sealed class SerializableProperty : ScriptObject
     {
     {
+        /// <summary>
+        /// Object field types support by the serializable property.
+        /// </summary>
         public enum FieldType
         public enum FieldType
         {
         {
             Int,
             Int,
@@ -35,10 +42,19 @@ namespace BansheeEngine
         private Getter getter;
         private Getter getter;
         private Setter setter;
         private Setter setter;
 
 
-        // Constructed from native code
+        /// <summary>
+        /// Constructor for internal use by the native code.
+        /// </summary>
         private SerializableProperty()
         private SerializableProperty()
         { }
         { }
 
 
+        /// <summary>
+        /// Finalizes construction of the serializable property. Must be called after creation.
+        /// </summary>
+        /// <param name="type">Type of data the property contains.</param>
+        /// <param name="internalType">Type of data the property contains, as C# type.</param>
+        /// <param name="getter">Method that allows you to retrieve contents of the property.</param>
+        /// <param name="setter">Method that allows you to set contents of the property</param>
         internal void Construct(FieldType type, Type internalType, Getter getter, Setter setter)
         internal void Construct(FieldType type, Type internalType, Getter getter, Setter setter)
         {
         {
             this.type = type;
             this.type = type;
@@ -47,21 +63,35 @@ namespace BansheeEngine
             this.setter = setter;
             this.setter = setter;
         }
         }
 
 
+        /// <summary>
+        /// Returns type of data the property contains.
+        /// </summary>
         public FieldType Type
         public FieldType Type
         {
         {
             get { return type; }
             get { return type; }
         }
         }
 
 
+        /// <summary>
+        /// Returns type of data the property contains, as C# type.
+        /// </summary>
         public Type InternalType
         public Type InternalType
         {
         {
             get { return internalType; }
             get { return internalType; }
         }
         }
 
 
+        /// <summary>
+        /// Is the containing type a value type (true), or a reference type (false).
+        /// </summary>
         public bool IsValueType
         public bool IsValueType
         {
         {
             get { return internalType.IsValueType; }
             get { return internalType.IsValueType; }
         }
         }
 
 
+        /// <summary>
+        /// Retrieves the value contained in the property.
+        /// </summary>
+        /// <typeparam name="T">Type of the value to retrieve. Caller must ensure the type matches the property type.</typeparam>
+        /// <returns>Value of the property.</returns>
         public T GetValue<T>()
         public T GetValue<T>()
         {
         {
             if (!typeof(T).IsAssignableFrom(internalType))
             if (!typeof(T).IsAssignableFrom(internalType))
@@ -70,6 +100,11 @@ namespace BansheeEngine
             return (T)getter();
             return (T)getter();
         }
         }
 
 
+        /// <summary>
+        /// Retrieves a copy of the value contained in the property.
+        /// </summary>
+        /// <typeparam name="T">Type of the value to retrieve. Caller must ensure the type matches the property type.</typeparam>
+        /// <returns>A deep copy of the value of the property.</returns>
         public T GetValueCopy<T>()
         public T GetValueCopy<T>()
         {
         {
             if (!typeof(T).IsAssignableFrom(internalType))
             if (!typeof(T).IsAssignableFrom(internalType))
@@ -78,6 +113,11 @@ namespace BansheeEngine
             return (T)Internal_CloneManagedInstance(mCachedPtr, getter());
             return (T)Internal_CloneManagedInstance(mCachedPtr, getter());
         }
         }
 
 
+        /// <summary>
+        /// Changes the value of the property.
+        /// </summary>
+        /// <typeparam name="T">Type of the value to set. Caller must ensure the type matches the property type.</typeparam>
+        /// <param name="value">New value to assign to the property.</param>
         public void SetValue<T>(T value)
         public void SetValue<T>(T value)
         {
         {
             if (!typeof(T).IsAssignableFrom(internalType))
             if (!typeof(T).IsAssignableFrom(internalType))
@@ -86,6 +126,10 @@ namespace BansheeEngine
             setter(value);
             setter(value);
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable object wrapper around the value contained in the property.
+        /// </summary>
+        /// <returns>Serializable object wrapper around the value contained in the property.</returns>
         public SerializableObject GetObject()
         public SerializableObject GetObject()
         {
         {
             if (type != FieldType.Object)
             if (type != FieldType.Object)
@@ -94,6 +138,11 @@ namespace BansheeEngine
             return Internal_CreateObject(mCachedPtr);
             return Internal_CreateObject(mCachedPtr);
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable array around the value contained in the property. Caller must ensure the property
+        /// contains an array.
+        /// </summary>
+        /// <returns>Serializable array around the value contained in the property.</returns>
         public SerializableArray GetArray()
         public SerializableArray GetArray()
         {
         {
             if (type != FieldType.Array)
             if (type != FieldType.Array)
@@ -102,6 +151,11 @@ namespace BansheeEngine
             return Internal_CreateArray(mCachedPtr);
             return Internal_CreateArray(mCachedPtr);
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable list around the value contained in the property. Caller must ensure the property
+        /// contains a list.
+        /// </summary>
+        /// <returns>Serializable list around the value contained in the property.</returns>
         public SerializableList GetList()
         public SerializableList GetList()
         {
         {
             if (type != FieldType.List)
             if (type != FieldType.List)
@@ -110,6 +164,11 @@ namespace BansheeEngine
             return Internal_CreateList(mCachedPtr);
             return Internal_CreateList(mCachedPtr);
         }
         }
 
 
+        /// <summary>
+        /// Returns a serializable dictionary around the value contained in the property. Caller must ensure the property
+        /// contains a dictionary.
+        /// </summary>
+        /// <returns>Serializable dictionary around the value contained in the property.</returns>
         public SerializableDictionary GetDictionary()
         public SerializableDictionary GetDictionary()
         {
         {
             if (type != FieldType.Dictionary)
             if (type != FieldType.Dictionary)
@@ -118,6 +177,12 @@ namespace BansheeEngine
             return Internal_CreateDictionary(mCachedPtr);
             return Internal_CreateDictionary(mCachedPtr);
         }
         }
 
 
+        /// <summary>
+        /// Creates a new instance of the type wrapped by this property.
+        /// </summary>
+        /// <typeparam name="T">Type of the object to create. Caller must ensure the type matches the property type and that
+        ///                     the property wraps an object.</typeparam>
+        /// <returns>A new instance of an object of type <typeparamref name="T"/>.</returns>
         public T CreateObjectInstance<T>()
         public T CreateObjectInstance<T>()
         {
         {
             if (type != FieldType.Object)
             if (type != FieldType.Object)
@@ -126,6 +191,13 @@ namespace BansheeEngine
             return (T)Internal_CreateManagedObjectInstance(mCachedPtr);
             return (T)Internal_CreateManagedObjectInstance(mCachedPtr);
         }
         }
 
 
+        /// <summary>
+        /// Creates a new instance of the array wrapped by this property. Caller must ensure this property contains an array.
+        /// </summary>
+        /// <param name="lengths">Size of each dimension of the array. Number of dimensions must match the number
+        ///                       of dimensions in the array wrapped by this property.</param>
+        /// <returns>A new array containing the same element type as the array wrapped by this property, of 
+        ///          <paramref name="lengths"/> sizes.</returns>
         public Array CreateArrayInstance(int[] lengths)
         public Array CreateArrayInstance(int[] lengths)
         {
         {
             if (type != FieldType.Array)
             if (type != FieldType.Array)
@@ -134,6 +206,12 @@ namespace BansheeEngine
             return Internal_CreateManagedArrayInstance(mCachedPtr, lengths);
             return Internal_CreateManagedArrayInstance(mCachedPtr, lengths);
         }
         }
 
 
+        /// <summary>
+        /// Creates a new instance of the list wrapped by this property. Caller must ensure this property contains a list.
+        /// </summary>
+        /// <param name="length">Size of the list.</param>
+        /// <returns>A new list containing the same element type as the list wrapped by this property, of
+        ///          <paramref name="length"/> size.</returns>
         public IList CreateListInstance(int length)
         public IList CreateListInstance(int length)
         {
         {
             if (type != FieldType.List)
             if (type != FieldType.List)
@@ -142,6 +220,12 @@ namespace BansheeEngine
             return Internal_CreateManagedListInstance(mCachedPtr, length);
             return Internal_CreateManagedListInstance(mCachedPtr, length);
         }
         }
 
 
+        /// <summary>
+        /// Creates a new instance of the dictionary wrapped by this property. Caller must ensure this property contains 
+        /// a dictionary.
+        /// </summary>
+        /// <returns>A new dictionary containing the same key/value types as the dictionary wrapped by this property.
+        ///          </returns>
         public IDictionary CreateDictionaryInstance()
         public IDictionary CreateDictionaryInstance()
         {
         {
             if (type != FieldType.Dictionary)
             if (type != FieldType.Dictionary)
@@ -177,6 +261,11 @@ namespace BansheeEngine
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern object Internal_CloneManagedInstance(IntPtr nativeInstance, object original);
         private static extern object Internal_CloneManagedInstance(IntPtr nativeInstance, object original);
 
 
+        /// <summary>
+        /// Converts a C# type into Banshee-specific serialization type.
+        /// </summary>
+        /// <param name="internalType">C# to convert.</param>
+        /// <returns>Banshee-specific serialization type. Throws an exception if matching type cannot be found.</returns>
         public static FieldType DetermineFieldType(Type internalType)
         public static FieldType DetermineFieldType(Type internalType)
         {
         {
             if (!internalType.IsArray)
             if (!internalType.IsArray)

+ 5 - 0
MBansheeEngine/SerializeField.cs

@@ -2,6 +2,11 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Attribute that may be used on fields to mark them as serializable. Normally public fields are serialized
+    /// by default, and you can use this attribute to mark private/protected/internal fields as serialized as well.
+    /// Fields must be in a serializable object otherwise this attribute has no effect.
+    /// </summary>
     [AttributeUsage(AttributeTargets.Field)]
     [AttributeUsage(AttributeTargets.Field)]
     public sealed class SerializeField : Attribute
     public sealed class SerializeField : Attribute
     {
     {

+ 4 - 0
MBansheeEngine/SerializeObject.cs

@@ -2,6 +2,10 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Forces a class or a struct to be serializable. Normally only Component and Resource types are serialized
+    /// but you can use this attribute to force arbitrary types to be serialized.
+    /// </summary>
     [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
     [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
     public sealed class SerializeObject : Attribute
     public sealed class SerializeObject : Attribute
     {
     {

+ 23 - 4
MBansheeEngine/Shader.cs

@@ -3,17 +3,27 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-    // Note: This must match C++ ShaderParameterType enum
-    public enum ShaderParameterType
+    /// <summary>
+    /// Type of parameters that can be defined in a shader.
+    /// </summary>
+    public enum ShaderParameterType // Note: Must match C++ ShaderParameterType enum
     {
     {
         Float, Vector2, Vector3, Vector4, Color,
         Float, Vector2, Vector3, Vector4, Color,
         Matrix3, Matrix4, Texture2D, 
         Matrix3, Matrix4, Texture2D, 
         Texture3D, TextureCube, Sampler
         Texture3D, TextureCube, Sampler
     }
     }
 
 
+    /// <summary>
+    /// Contains information about a shader parameter.
+    /// </summary>
     public struct ShaderParameter
     public struct ShaderParameter
     {
     {
-        public ShaderParameter(string name, ShaderParameterType type)
+        /// <summary>
+        /// Creates a new shader parameter.
+        /// </summary>
+        /// <param name="name">Name of the parameter.</param>
+        /// <param name="type">Type of the parameter.</param>
+        internal ShaderParameter(string name, ShaderParameterType type)
         {
         {
             this.name = name;
             this.name = name;
             this.type = type;
             this.type = type;
@@ -23,12 +33,21 @@ namespace BansheeEngine
         public ShaderParameterType type;
         public ShaderParameterType type;
     }
     }
 
 
+    /// <summary>
+    /// Contains definitions of GPU programs used for rendering, as well as a set of global parameters to control those
+    /// programs.
+    /// </summary>
     public class Shader : Resource
     public class Shader : Resource
     {
     {
-        // For internal use by the runtime
+        /// <summary>
+        /// Constuctor for internal runtime use only.
+        /// </summary>
         private Shader()
         private Shader()
         { }
         { }
 
 
+        /// <summary>
+        /// Returns data about all parameters available in the shader.
+        /// </summary>
         public ShaderParameter[] Parameters
         public ShaderParameter[] Parameters
         {
         {
             get
             get

+ 19 - 1
MBansheeEngine/ShortcutKey.cs

@@ -2,18 +2,36 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// A key combination that is used for triggering keyboard shortcuts. Contains a button code and an optional modifier.
+    /// </summary>
     [StructLayout(LayoutKind.Sequential)]
     [StructLayout(LayoutKind.Sequential)]
-    public struct ShortcutKey
+    public struct ShortcutKey // Note: Must match C++ class ShortcutKey
     {
     {
+        /// <summary>
+        /// Optional modifier that is required to be pressed along with the shortcut button
+        /// </summary>
         public ButtonModifier modifier;
         public ButtonModifier modifier;
+
+        /// <summary>
+        /// Shortcut button that triggers the shortcut.
+        /// </summary>
         public ButtonCode key;
         public ButtonCode key;
 
 
+        /// <summary>
+        /// Creates a new shortcut key.
+        /// </summary>
+        /// <param name="modifier">Optional modifier that is required to be pressed along with the shortcut button.</param>
+        /// <param name="key">Shortcut button that triggers the shortcut.</param>
         public ShortcutKey(ButtonModifier modifier, ButtonCode key)
         public ShortcutKey(ButtonModifier modifier, ButtonCode key)
         {
         {
             this.modifier = modifier;
             this.modifier = modifier;
             this.key = key;
             this.key = key;
         }
         }
 
 
+        /// <summary>
+        /// Blank shortcut key that is triggered by no key combination.
+        /// </summary>
         public static ShortcutKey None = new ShortcutKey(ButtonModifier.None, ButtonCode.Unassigned);
         public static ShortcutKey None = new ShortcutKey(ButtonModifier.None, ButtonCode.Unassigned);
     }
     }
 }
 }

+ 15 - 1
MBansheeEngine/Sphere.cs

@@ -2,24 +2,38 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// A sphere represented by a center point and a radius.
+    /// </summary>
     [StructLayout(LayoutKind.Sequential), SerializeObject]
     [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct Sphere
+    public struct Sphere // Note: Must match C++ enum Sphere
     {
     {
         private float _radius;
         private float _radius;
         private Vector3 _center;
         private Vector3 _center;
         
         
+        /// <summary>
+        /// Center point of the sphere.
+        /// </summary>
         public Vector3 Center
         public Vector3 Center
         {
         {
             get { return _center; }
             get { return _center; }
             set { _center = value; }
             set { _center = value; }
         }
         }
 
 
+        /// <summary>
+        /// Radius of the sphere.
+        /// </summary>
         public float Radius
         public float Radius
         {
         {
             get { return _radius; }
             get { return _radius; }
             set { _radius = value; }
             set { _radius = value; }
         }
         }
 
 
+        /// <summary>
+        /// Creates a new sphere object.
+        /// </summary>
+        /// <param name="center">Center point of the sphere.</param>
+        /// <param name="radius">Radius of the sphere.</param>
         public Sphere(Vector3 center, float radius)
         public Sphere(Vector3 center, float radius)
         {
         {
             _center = center;
             _center = center;

+ 20 - 5
MBansheeEngine/SpriteTexture.cs

@@ -2,19 +2,34 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-    public sealed class SpriteTexture : Resource // TODO - Dummy class
+    /// <summary>
+    /// Texture interface that encapsulates underlying texture which allows us to create a sprite texture atlas 
+    /// (e.g. multiple sprite textures referencing different parts of a single texture).
+    /// </summary>
+    public sealed class SpriteTexture : Resource
     {
     {
-        // For internal use by the runtime
+        /// <summary>
+        /// Constructor for internal use by the runtime.
+        /// </summary>
         private SpriteTexture()
         private SpriteTexture()
-        {
-            
-        }
+        { }
 
 
+        /// <summary>
+        /// Creates a new sprite texture that references the entire area of the provided texture.
+        /// </summary>
+        /// <param name="texture">Texture to wrap by the sprite texture.</param>
         public SpriteTexture(Texture2D texture)
         public SpriteTexture(Texture2D texture)
         {
         {
             Internal_CreateInstance(this, texture, Vector2.Zero, Vector2.One);
             Internal_CreateInstance(this, texture, Vector2.Zero, Vector2.One);
         }
         }
 
 
+        /// <summary>
+        /// Creates a new sprite texture that references a sub-area of the provided texture.
+        /// </summary>
+        /// <param name="texture">Texture to wrap by the sprite texture.</param>
+        /// <param name="uvOffset">Top-left position of the area used by the sprite texture, in normalized coordinates.
+        ///                        </param>
+        /// <param name="uvScale">Size of the area used by the sprite texture, in normalized coordinates.</param>
         public SpriteTexture(Texture2D texture, Vector2 uvOffset, Vector2 uvScale)
         public SpriteTexture(Texture2D texture, Vector2 uvOffset, Vector2 uvScale)
         {
         {
             Internal_CreateInstance(this, texture, uvOffset, uvScale);
             Internal_CreateInstance(this, texture, uvOffset, uvScale);