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

+ 1 - 1
BansheeEditor/Include/BsCmdCloneSO.h

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		 * @brief	Creates new scene object(s) by cloning existing objects.
 		 *			Automatically registers the command with undo/redo system.
 		 *
-		 * @param	sceneObjects	 Scene object(s) to clone.
+		 * @param	sceneObjects	Scene object(s) to clone.
 		 * @param	description		Optional description of what exactly the command does.
 		 *
 		 * @return	Cloned objects.

+ 4 - 4
BansheeEditor/Include/BsProjectLibrary.h

@@ -114,7 +114,7 @@ namespace BansheeEngine
 		LibraryEntry* findEntry(const Path& path) const;
 
 		/**
-		 * @brief	Searches the library for a pattern.
+		 * @brief	 Searches the library for a pattern and returns all entries matching it.
 		 *
 		 * @param	pattern	Pattern to search for. Use wildcard * to match any character(s).
 		 *
@@ -157,14 +157,14 @@ namespace BansheeEngine
 		 *
 		 * @param	resource	Resource instance to add to the library. A copy of the
 		 *						resource will be saved at the provided path.
-		 * @param	path		Absolute path to where to store the resource.
+		 * @param	path		Path where where to store the resource. Absolute or relative to the resources folder.
 		 */
 		void createEntry(const HResource& resource, const Path& path);
 
 		/**
 		 * @brief	Creates a new folder in the library.
 		 *
-		 * @param	path		Absolute path to where to store the folder.
+		 * @param	path		Path where where to store the folder. Absolute or relative to the resources folder.
 		 */
 		void createFolderEntry(const Path& path);
 
@@ -205,7 +205,7 @@ namespace BansheeEngine
 		 * @param	importOptions	Optional import options to use when importing the resource. Caller must ensure the
 		 *							import options are of the correct type for the resource in question. If null is provided
 		 *							default import options are used.
-		 * @param	forceReimport	Should the resource be reimported even if we detect no changes. This should be true
+		 * @param	forceReimport	Should the resource be reimported even if no changes are detected. This should be true
 		 *							if import options changed since last import.
 		 */
 		void reimport(const Path& path, const ImportOptionsPtr& importOptions = nullptr, bool forceReimport = false);

+ 2 - 1
BansheeEditor/Include/BsSelection.h

@@ -6,7 +6,8 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Handles SceneObject and Resource selection.
+	 * @brief	Handles scene object and resource selection. Triggeres events when selection changes and allows the 
+	 *			user to query current selection state.
 	 */
 	class BS_ED_EXPORT Selection : public Module<Selection>
 	{

+ 1 - 1
BansheeEditor/Include/BsUndoRedo.h

@@ -6,7 +6,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Handles editor-wide undo & redo operations.
+	 * @brief	Provides functionality to undo or redo recently performed operations in the editor.
 	 */
 	class BS_ED_EXPORT UndoRedo : public Module<UndoRedo>
 	{

+ 6 - 3
BansheeUtility/Source/Win32/BsFileSystem.cpp

@@ -358,7 +358,8 @@ namespace BansheeEngine
 				win32_remove(newPathStr);
 			else
 			{
-				BS_EXCEPT(InvalidStateException, "Move operation failed because another file already exists at the new path: \"" + toString(newPathStr) + "\"");
+				LOGWRN("Move operation failed because another file already exists at the new path: \"" + toString(newPathStr) + "\"");
+				return;
 			}
 		}
 
@@ -394,7 +395,8 @@ namespace BansheeEngine
 						win32_remove(destPathStr);
 					else
 					{
-						BS_EXCEPT(InvalidStateException, "Copy operation failed because another file already exists at the new path: \"" + toString(destPathStr) + "\"");
+						LOGWRN("Copy operation failed because another file already exists at the new path: \"" + toString(destPathStr) + "\"");
+						return;
 					}
 				}
 			}
@@ -403,7 +405,8 @@ namespace BansheeEngine
 
 			if (!srcIsFile && destIsFile)
 			{
-				BS_EXCEPT(InvalidStateException, "Cannot copy a source folder to a destination file.");
+				LOGWRN("Cannot copy a source folder to a destination file.");
+				return;
 			}
 			else if (srcIsFile && !destIsFile)
 			{

+ 2 - 2
MBansheeEditor/Library/LibraryWindow.cs

@@ -587,9 +587,9 @@ namespace BansheeEditor
             if (!onlyInternal)
             {
                 if (selectionPaths != null)
-                    Selection.resourcePaths = selectionPaths.ToArray();
+                    Selection.ResourcePaths = selectionPaths.ToArray();
                 else
-                    Selection.resourcePaths = new string[0];
+                    Selection.ResourcePaths = new string[0];
             }
         }
 

+ 15 - 15
MBansheeEditor/MenuItems.cs

@@ -18,7 +18,7 @@ namespace BansheeEditor
         [MenuItem("Components/Camera", 7050)]
         private static void AddCamera()
         {
-            SceneObject so = Selection.sceneObject;
+            SceneObject so = Selection.SceneObject;
             if (so == null)
                 return;
 
@@ -32,7 +32,7 @@ namespace BansheeEditor
         [MenuItem("Components/Renderable", 7049)]
         private static void AddRenderable()
         {
-            SceneObject so = Selection.sceneObject;
+            SceneObject so = Selection.SceneObject;
             if (so == null)
                 return;
 
@@ -46,7 +46,7 @@ namespace BansheeEditor
         [MenuItem("Components/Point light", 7048)]
         private static void AddPointLight()
         {
-            SceneObject so = Selection.sceneObject;
+            SceneObject so = Selection.SceneObject;
             if (so == null)
                 return;
 
@@ -61,7 +61,7 @@ namespace BansheeEditor
         [MenuItem("Components/Spot light", 7047)]
         private static void AddSpotLight()
         {
-            SceneObject so = Selection.sceneObject;
+            SceneObject so = Selection.SceneObject;
             if (so == null)
                 return;
 
@@ -76,7 +76,7 @@ namespace BansheeEditor
         [MenuItem("Components/Directional light", 7046)]
         private static void AddDirectionalLight()
         {
-            SceneObject so = Selection.sceneObject;
+            SceneObject so = Selection.SceneObject;
             if (so == null)
                 return;
 
@@ -94,7 +94,7 @@ namespace BansheeEditor
             SceneObject so = UndoRedo.CreateSO("Camera", "Created a Camera");
             so.AddComponent<Camera>();
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -106,7 +106,7 @@ namespace BansheeEditor
             SceneObject so = UndoRedo.CreateSO("Renderable", "Created a Renderable");
             so.AddComponent<Renderable>();
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -119,7 +119,7 @@ namespace BansheeEditor
             Light light = so.AddComponent<Light>();
             light.Type = LightType.Point;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -132,7 +132,7 @@ namespace BansheeEditor
             Light light = so.AddComponent<Light>();
             light.Type = LightType.Spot;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -145,7 +145,7 @@ namespace BansheeEditor
             Light light = so.AddComponent<Light>();
             light.Type = LightType.Directional;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -158,7 +158,7 @@ namespace BansheeEditor
             Renderable renderable = so.AddComponent<Renderable>();
             renderable.Mesh = Builtin.Box;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -171,7 +171,7 @@ namespace BansheeEditor
             Renderable renderable = so.AddComponent<Renderable>();
             renderable.Mesh = Builtin.Sphere;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -184,7 +184,7 @@ namespace BansheeEditor
             Renderable renderable = so.AddComponent<Renderable>();
             renderable.Mesh = Builtin.Cone;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -197,7 +197,7 @@ namespace BansheeEditor
             Renderable renderable = so.AddComponent<Renderable>();
             renderable.Mesh = Builtin.Quad;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
 
         /// <summary>
@@ -210,7 +210,7 @@ namespace BansheeEditor
             Renderable renderable = so.AddComponent<Renderable>();
             renderable.Mesh = Builtin.Disc;
 
-            Selection.sceneObject = so;
+            Selection.SceneObject = so;
         }
     }
 }

+ 29 - 0
MBansheeEditor/ProgressBar.cs

@@ -3,6 +3,9 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// A modal window that displays a progress bar.
+    /// </summary>
     public class ProgressBar : ModalWindow
     {
         private static ProgressBar instance;
@@ -10,17 +13,31 @@ namespace BansheeEditor
         private GUIProgressBar progressBar;
         private GUILabel messageLabel;
 
+        /// <summary>
+        /// Determines size of the filled portion of the progress bar, in range [0, 1].
+        /// </summary>
         public float Percent
         {
             set { progressBar.Percent = value; }
             get { return progressBar.Percent; }
         }
 
+        /// <summary>
+        /// Shows a progress bar window.
+        /// </summary>
+        /// <param name="title">Text to show in the title.</param>
+        /// <param name="percent">Initial value to show the progress as, in range [0, 1].</param>
         public static void Show(LocString title, float percent)
         {
             Show(title, "", percent);
         }
 
+        /// <summary>
+        /// Shows a progress bar window.
+        /// </summary>
+        /// <param name="title">Text to show in the title.</param>
+        /// <param name="message">Message to show above the progress bar.</param>
+        /// <param name="percent">Initial value to show the progress as, in range [0, 1].</param>
         public static void Show(LocString title, LocString message, float percent)
         {
             if (instance == null)
@@ -29,6 +46,12 @@ namespace BansheeEditor
             instance.Initialize(title, message, percent);
         }
 
+        /// <summary>
+        /// Initializes the progress bar window. Must be called after construction and before use.
+        /// </summary>
+        /// <param name="title">Text to show in the title.</param>
+        /// <param name="message">Message to show above the progress bar.</param>
+        /// <param name="percent">Initial value to show the progress as, in range [0, 1].</param>
         private void Initialize(LocString title, LocString message, float percent)
         {
             Width = 350;
@@ -39,6 +62,9 @@ namespace BansheeEditor
             messageLabel.SetContent(message);
         }
 
+        /// <summary>
+        /// Hides the progress bar, closing the window.
+        /// </summary>
         public static void Hide()
         {
             if (instance != null)
@@ -47,6 +73,9 @@ namespace BansheeEditor
             instance = null;
         }
 
+        /// <summary>
+        /// Creates a new uninitialized progress bar.
+        /// </summary>
         protected ProgressBar()
             :base(false)
         { }

+ 183 - 7
MBansheeEditor/ProjectLibrary.cs

@@ -6,12 +6,32 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// The primary location for interacting with all the resources in the current project. A complete hierarchy of 
+    /// resources is provided which can be interacted with by importing new ones, deleting them, moving, renaming and similar.
+    /// </summary>
     public sealed class ProjectLibrary : ScriptObject
     {
+        /// <summary>
+        /// Root entry of the project library, referencing the top level resources folder.
+        /// </summary>
         public static DirectoryEntry Root { get { return Internal_GetRoot(); } }
+
+        /// <summary>
+        /// Absolute path to the current project's project library resource folder.
+        /// </summary>
         public static string ResourceFolder { get { return Internal_GetResourceFolder(); } }
 
+        /// <summary>
+        /// Triggered when a new entry is added to the project library. Provided path relative to the project library 
+        /// resources folder.
+        /// </summary>
         public static event Action<string> OnEntryAdded;
+
+        /// <summary>
+        /// Triggered when an entry is removed from the project library. Provided path relative to the project library 
+        /// resources folder.
+        /// </summary>
         public static event Action<string> OnEntryRemoved;
 
         private static HashSet<string> queuedForImport = new HashSet<string>();
@@ -20,6 +40,9 @@ namespace BansheeEditor
 
         private const float TIME_SLICE_SECONDS = 0.030f;
 
+        /// <summary>
+        /// Checks the project library folder for any modifications and reimports the required resources.
+        /// </summary>
         public static void Refresh()
         {
             string[] modifiedPaths = Internal_Refresh(ResourceFolder, false);
@@ -30,6 +53,11 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Checks the specified folder for any modifications and reimports the required resources.
+        /// </summary>
+        /// <param name="path">Path to a file or folder to refresh. Relative to the project library resources folder or 
+        ///                    absolute.</param>
         public static void Refresh(string path)
         {
             string[] modifiedPaths = Internal_Refresh(path, false);
@@ -40,81 +68,172 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Registers a new resource in the library.
+        /// </summary>
+        /// <param name="resource">Resource instance to add to the library. A copy of the resource will be saved at the 
+        ///                        provided path.</param>
+        /// <param name="path">Path where where to store the resource. Absolute or relative to the resources folder.</param>
         public static void Create(Resource resource, string path)
         {
             Internal_Create(resource, path);
         }
 
+        /// <summary>
+        /// Updates a resource that is already in the library.
+        /// </summary>
+        /// <param name="resource">Resource to save.</param>
         public static void Save(Resource resource)
         {
             Internal_Save(resource);
         }
 
+        /// <summary>
+        /// Loads a resource from the project library.
+        /// </summary>
+        /// <typeparam name="T">Type of the resource to load.</typeparam>
+        /// <param name="path">Path of the resource to load. Absolute or relative to the resources folder.</param>
+        /// <returns>Instance of the loaded resource, or null if not found.</returns>
         public static T Load<T>(string path) where T : Resource
         {
             return (T) Internal_Load(path);
         }
 
+        /// <summary>
+        /// Triggers a reimport of a resource using the provided import options, if needed.
+        /// </summary>
+        /// <param name="path">Path to the resource to reimport, absolute or relative to resources folder.</param>
+        /// <param name="options">ptional import options to use when importing the resource. Caller must ensure the import
+        ///                       options are of the correct type for the resource in question. If null is provided default 
+        ///                       import options are used.</param>
+        /// <param name="force">Should the resource be reimported even if no changes are detected.</param>
         public static void Reimport(string path, ImportOptions options = null, bool force = false)
         {
             Internal_Reimport(path, options, force);
         }
 
+        /// <summary>
+        /// Checks does the project library contain a resource at the specified path.
+        /// </summary>
+        /// <param name="path">Path to the resource to check, absolute or relative to resources folder.</param>
+        /// <returns>True if the resourc exists, false otherwise.</returns>
         public static bool Exists(string path)
         {
             return GetEntry(path) != null;
         }
 
+        /// <summary>
+        /// Attempts to locate a library entry that describes a file or a folder in the project library.
+        /// </summary>
+        /// <param name="path">Path to the entry to retrieve, absolute or relative to resources folder.</param>
+        /// <returns>Library entry if found, null otherwise. This object can become invalid on the next library refresh
+        ///          and you are not meant to hold a permanent reference to it.</returns>
         public static LibraryEntry GetEntry(string path)
         {
             return Internal_GetEntry(path);
         }
 
+        /// <summary>
+        /// Searches the library for a pattern and returns all entries matching it.
+        /// </summary>
+        /// <param name="pattern">Pattern to search for. Use wildcard * to match any character(s).</param>
+        /// <param name="types">Type of resources to search for. If null all entries will be searched.</param>
+        /// <returns>A set of entries matching the pattern. These objects can become invalid on the next library refresh
+        ///          and you are not meant to hold a permanent reference to them.</returns>
         public static LibraryEntry[] Search(string pattern, ResourceType[] types = null)
         {
             return Internal_Search(pattern, types);
         }
 
+        /// <summary>
+        /// Returns a path to a resource stored in the project library.
+        /// </summary>
+        /// <param name="resource">Resource to find the path for.</param>
+        /// <returns>Path to relative to the project library resources folder if resource was found, null otherwise.
+        ///          </returns>
         public static string GetPath(Resource resource)
         {
             return Internal_GetPath(resource);
         }
 
+        /// <summary>
+        /// Returns a path to a resource with the specified UUID stored in the project library.
+        /// </summary>
+        /// <param name="uuid">Unique identifier of the resources to retrieve the path of.</param>
+        /// <returns>Path to relative to the project library resources folder if resource was found, null otherwise.
+        ///          </returns>
         public static string GetPath(string uuid)
         {
             return Internal_GetPathFromUUID(uuid);
         }
 
+        /// <summary>
+        /// Deletes a resource in the project library.
+        /// </summary>
+        /// <param name="path">Path to the entry to delete, absolute or relative to resources folder.</param>
         public static void Delete(string path)
         {
             Internal_Delete(path);
         }
 
+        /// <summary>
+        /// Creates a new folder in the library.
+        /// </summary>
+        /// <param name="path">Path of the folder to create. Absolute or relative to the resources folder.</param>
         public static void CreateFolder(string path)
         {
             Internal_CreateFolder(path);
         }
 
-        public static void Rename(string path, string name)
+        /// <summary>
+        /// Renames an entry in the project library.
+        /// </summary>
+        /// <param name="path">Path of the entry to rename, absolute or relative to resources folder.</param>
+        /// <param name="name">New name of the entry with an extension.</param>
+        /// <param name="overwrite">Determines should the entry be deleted if one with the provided name already exists. If
+        ///                         this is false and an entry already exists, no rename operation will be performed.</param>
+        public static void Rename(string path, string name, bool overwrite = false)
         {
-            Internal_Rename(path, name);
+            Internal_Rename(path, name, false);
         }
 
+        /// <summary>
+        /// Moves an entry in the project library from one path to another.
+        /// </summary>
+        /// <param name="oldPath">Source path of the entry, absolute or relative to resources folder.</param>
+        /// <param name="newPath">Destination path of the entry, absolute or relative to resources folder.</param>
+        /// <param name="overwrite">Determines should the entry be deleted if one at the destination path already exists. If
+        ///                         this is false and an entry already exists, no move operation will be performed.</param>
         public static void Move(string oldPath, string newPath, bool overwrite = false)
         {
             Internal_Move(oldPath, newPath, overwrite);
         }
 
+        /// <summary>
+        /// Copies an entry in the project library from one path to another.
+        /// </summary>
+        /// <param name="source">Source path of the entry, absolute or relative to resources folder.</param>
+        /// <param name="destination">Destination path of the entry, absolute or relative to resources folder.</param>
+        /// <param name="overwrite">Determines should the entry be deleted if one at the destination path already exists. If
+        ///                         this is false and an entry already exists, no copy operation will be performed.</param>
         public static void Copy(string source, string destination, bool overwrite = false)
         {
             Internal_Copy(source, destination, overwrite);
         }
 
+        /// <summary>
+        /// Controls should a resource be included an a build. All dependant resources will also be included.
+        /// </summary>
+        /// <param name="path">Path of the resource to include, absolute or relative to resources folder.</param>
+        /// <param name="include">True if it should be included, false otherwise.</param>
         public static void SetIncludeInBuild(string path, bool include)
         {
             Internal_SetIncludeInBuild(path, include);
         }
 
+        /// <summary>
+        /// Triggers reimport for queued resource. Should be called once per frame.
+        /// </summary>
         internal static void Update()
         {
             if (queuedForImport.Count > 0)
@@ -166,12 +285,20 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered internally by the runtime when a new entry is added to the project library.
+        /// </summary>
+        /// <param name="path">Path relative to the project library resources folder.</param>
         private static void Internal_DoOnEntryAdded(string path)
         {
             if (OnEntryAdded != null)
                 OnEntryAdded(path);
         }
 
+        /// <summary>
+        /// Triggered internally by the runtime when an entry is removed from the project library.
+        /// </summary>
+        /// <param name="path">Path relative to the project library resources folder.</param>
         private static void Internal_DoOnEntryRemoved(string path)
         {
             if (OnEntryRemoved != null)
@@ -215,7 +342,7 @@ namespace BansheeEditor
         private static extern void Internal_CreateFolder(string path);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Rename(string path, string name);
+        private static extern void Internal_Rename(string path, string name, bool overwrite);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_Move(string oldPath, string newPath, bool overwrite);
@@ -230,24 +357,45 @@ namespace BansheeEditor
         private static extern void Internal_SetIncludeInBuild(string path, bool force);
     }
 
-    // Note: Must be the same as C++ enum ProjectLibrary::LibraryEntryType
-    public enum LibraryEntryType
+    /// <summary>
+    /// Type of project library entries.
+    /// </summary>
+    public enum LibraryEntryType // Note: Must match the C++ enum ProjectLibrary::LibraryEntryType
     {
         File, Directory
     }
 
-    // Note: Must be the same as C++ enum ScriptResourceType
-    public enum ResourceType
+    /// <summary>
+    /// Type of resources supported by the project library.
+    /// </summary>
+    public enum ResourceType // Note: Must match the C++ enum ScriptResourceType
     {
         Texture, SpriteTexture, Mesh, Font, Shader, Material, Prefab, PlainText, ScriptCode, StringTable, GUISkin, Undefined
     }
 
+    /// <summary>
+    /// A generic project library entry that may be a file or a folder.
+    /// </summary>
     public class LibraryEntry : ScriptObject
     {
+        /// <summary>
+        /// Path of the library entry, relative to the project library resources folder.
+        /// </summary>
         public string Path { get { return Internal_GetPath(mCachedPtr); } }
+
+        /// <summary>
+        /// Name of the library entry.
+        /// </summary>
         public string Name { get { return Internal_GetName(mCachedPtr); } }
 
+        /// <summary>
+        /// Type of the library entry.
+        /// </summary>
         public LibraryEntryType Type { get { return Internal_GetType(mCachedPtr); } }
+
+        /// <summary>
+        /// Directory entry that contains this entry. This may be null for the root entry.
+        /// </summary>
         public DirectoryEntry Parent { get { return Internal_GetParent(mCachedPtr); } }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -263,20 +411,48 @@ namespace BansheeEditor
         private static extern DirectoryEntry Internal_GetParent(IntPtr thisPtr);
     }
 
+    /// <summary>
+    /// A project library entry representing a directory that contains other entries.
+    /// </summary>
     public class DirectoryEntry : LibraryEntry
     {
+        /// <summary>
+        /// A set of entries contained in this entry.
+        /// </summary>
         public LibraryEntry[] Children { get { return Internal_GetChildren(mCachedPtr); } }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern LibraryEntry[] Internal_GetChildren(IntPtr thisPtr);
     }
 
+    /// <summary>
+    /// A library entry representing a resource.
+    /// </summary>
     public class FileEntry : LibraryEntry
     {
+        /// <summary>
+        /// Import options used for importing the resource.
+        /// </summary>
         public ImportOptions Options { get { return Internal_GetImportOptions(mCachedPtr); } }
+
+        /// <summary>
+        /// Unique identifier of the resource.
+        /// </summary>
         public string UUID { get { return Internal_GetUUID(mCachedPtr); } }
+
+        /// <summary>
+        /// Custom icon for the resource to display in the editor, if the resource has one.
+        /// </summary>
         public Texture2D Icon { get { return Internal_GetIcon(mCachedPtr); } }
+
+        /// <summary>
+        /// Type of the resource referenced by this entry.
+        /// </summary>
         public ResourceType ResType { get { return Internal_GetResourceType(mCachedPtr); } }
+
+        /// <summary>
+        /// Determines will the resource be included in the project build.
+        /// </summary>
         public bool IncludeInBuild { get { return Internal_GetIncludeInBuild(mCachedPtr); } }
 
         [MethodImpl(MethodImplOptions.InternalCall)]

+ 34 - 1
MBansheeEditor/ProjectWindow.cs

@@ -8,17 +8,27 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Project management window that allows the user to open and create new projects.
+    /// </summary>
     public class ProjectWindow : ModalWindow
     {
         private GUITextField projectInputBox;
         private GUIScrollArea recentProjectsArea;
         private GUIToggle autoLoadToggle;
 
+        /// <summary>
+        /// Opens the project management window.
+        /// </summary>
+        /// <returns>Instance of the project window</returns>
         public static ProjectWindow Open()
         {
             return new ProjectWindow();
         }
 
+        /// <summary>
+        /// Constructs a new project window.
+        /// </summary>
         protected ProjectWindow()
             : base(true)
         {
@@ -101,7 +111,10 @@ namespace BansheeEditor
             RefreshRecentProjects();
         }
 
-        void OpenProject()
+        /// <summary>
+        /// Attempts to open a project at the path currently entered in the project path input box.
+        /// </summary>
+        private void OpenProject()
         {
             string projectPath = projectInputBox.Value;
 
@@ -147,6 +160,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the browse button. Opens a browse dialog that allows the user to select
+        /// a project folder anywhere on the file system.
+        /// </summary>
         void BrowseClicked()
         {
             string projectPath = projectInputBox.Value;
@@ -158,6 +175,11 @@ namespace BansheeEditor
                 projectInputBox.Value = selectedPath;
         }
 
+        /// <summary>
+        /// Triggered when the user clicks on the create buttons. Opens a browse dialog that allows the user to select
+        /// a folde to a new project to create. Project data will be initialized in the chosen folder and new project
+        /// will be opened.
+        /// </summary>
         void CreateClicked()
         {
             string projectPath = projectInputBox.Value;
@@ -174,6 +196,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Updates GUI for the recent projects list.
+        /// </summary>
         private void RefreshRecentProjects()
         {
             GUILayout scrollLayout = recentProjectsArea.Layout;
@@ -196,11 +221,19 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when an entry in the recent projects list was clicked.
+        /// </summary>
+        /// <param name="path">Absolute path to the project folder that was selected.</param>
         void OnEntryClicked(string path)
         {
             projectInputBox.Value = path;
         }
 
+        /// <summary>
+        /// Triggered when an entry in the recent projects list was double clicked. Opens the project at the selected path.
+        /// </summary>
+        /// <param name="path">Absolute path to the project folder that was selected.</param>
         void OnEntryDoubleClicked(string path)
         {
             projectInputBox.Value = path;

+ 2 - 2
MBansheeEditor/Scene/DefaultHandleManager.cs

@@ -46,7 +46,7 @@ namespace BansheeEditor
         /// <inheritdoc/>
         protected internal override void PreInput()
         {
-            SceneObject[] selectedSceneObjects = Selection.sceneObjects;
+            SceneObject[] selectedSceneObjects = Selection.SceneObjects;
 
             if (selectedSceneObjects.Length == 0)
             {
@@ -125,7 +125,7 @@ namespace BansheeEditor
                     {
                         isDragged = true;
 
-                        SceneObject[] selectedSceneObjects = Selection.sceneObjects;
+                        SceneObject[] selectedSceneObjects = Selection.SceneObjects;
                         activeSelection = new HandledObject[selectedSceneObjects.Length];
                         for (int i = 0; i < selectedSceneObjects.Length; i++)
                             activeSelection[i] = new HandledObject(selectedSceneObjects[0]);

+ 1 - 1
MBansheeEditor/Scene/SceneWindow.cs

@@ -224,7 +224,7 @@ namespace BansheeEditor
 
                     if (VirtualInput.IsButtonUp(duplicateKey))
                     {
-                        SceneObject[] selectedObjects = Selection.sceneObjects;
+                        SceneObject[] selectedObjects = Selection.SceneObjects;
                         CleanDuplicates(ref selectedObjects);
 
                         if (selectedObjects.Length > 0)

+ 129 - 64
MBansheeEditor/ScriptCompiler.cs

@@ -11,17 +11,102 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Type of assemblies that may be generated by the script compiler.
+    /// </summary>
     public enum ScriptAssemblyType
     {
         Game, Editor
     }
 
+    /// <summary>
+    /// Data required for compiling a single assembly.
+    /// </summary>
     public struct CompileData
     {
         public string[] files;
         public string defines;
     }
 
+    /// <summary>
+    /// Compiles script files in the project into script assemblies.
+    /// </summary>
+    public static class ScriptCompiler
+    {
+        /// <summary>
+        /// Starts compilation of the script files in the project for the specified assembly for the specified platform.
+        /// </summary>
+        /// <param name="type">Type of the assembly to compile. This determines which script files are used as input.</param>
+        /// <param name="platform">Platform to compile the assemblies for.</param>
+        /// <param name="debug">Determines should the assemblies contain debug information.</param>
+        /// <param name="outputDir">Absolute path to the directory where to output the assemblies.</param>
+        /// <returns>Compiler instance that contains the compiler process. Caller must ensure to properly dispose
+        ///          of this object when done.</returns>
+        public static CompilerInstance CompileAsync(ScriptAssemblyType type, PlatformType platform, bool debug, string outputDir)
+        {
+            LibraryEntry[] scriptEntries = ProjectLibrary.Search("*", new ResourceType[] { ResourceType.ScriptCode });
+
+            List<string> scriptFiles = new List<string>();
+            for (int i = 0; i < scriptEntries.Length; i++)
+            {
+                if(scriptEntries[i].Type != LibraryEntryType.File)
+                    continue;
+
+                FileEntry fileEntry = (FileEntry)scriptEntries[i];
+
+                ScriptCodeImportOptions io = (ScriptCodeImportOptions) fileEntry.Options;
+                if (io.EditorScript && type == ScriptAssemblyType.Editor ||
+                    !io.EditorScript && type == ScriptAssemblyType.Game)
+                {
+                    scriptFiles.Add(Path.Combine(ProjectLibrary.ResourceFolder, scriptEntries[i].Path));
+                }
+            }
+
+            string[] assemblyFolders;
+            string[] assemblies;
+            string outputFile;
+
+            string[] frameworkAssemblies = BuildManager.GetFrameworkAssemblies(platform);
+            if (type == ScriptAssemblyType.Game)
+            {
+                assemblyFolders = new string[]
+                {
+                    EditorApplication.BuiltinAssemblyPath, 
+                    EditorApplication.FrameworkAssemblyPath
+                };
+
+                assemblies = new string[frameworkAssemblies.Length + 1];
+                assemblies[assemblies.Length - 1] = EditorApplication.EngineAssembly;
+
+                outputFile = Path.Combine(outputDir, EditorApplication.ScriptGameAssembly);
+            }
+            else
+            {
+                assemblyFolders = new string[]
+                {
+                    EditorApplication.BuiltinAssemblyPath, 
+                    EditorApplication.FrameworkAssemblyPath,
+                    EditorApplication.ScriptAssemblyPath
+                };
+
+                assemblies = new string[frameworkAssemblies.Length + 3];
+                assemblies[assemblies.Length - 1] = EditorApplication.EngineAssembly;
+                assemblies[assemblies.Length - 2] = EditorApplication.EditorAssembly;
+                assemblies[assemblies.Length - 3] = EditorApplication.ScriptGameAssembly;
+
+                outputFile = Path.Combine(outputDir, EditorApplication.ScriptEditorAssembly);
+            }
+
+            Array.Copy(frameworkAssemblies, assemblies, frameworkAssemblies.Length);
+
+            string defines = BuildManager.GetDefines(platform);
+            return new CompilerInstance(scriptFiles.ToArray(), defines, assemblyFolders, assemblies, debug, outputFile);
+        }
+    }
+
+    /// <summary>
+    /// Represents a started compiler process used for compiling a set of script files into an assembly.
+    /// </summary>
     public class CompilerInstance
     {
         private Process process;
@@ -33,6 +118,15 @@ namespace BansheeEditor
         private Regex compileErrorRegex = new Regex(@"\s*(?<file>.*)\(\s*(?<line>\d+)\s*,\s*(?<column>\d+)\s*\)\s*:\s*(?<type>warning|error)\s+(.*):\s*(?<message>.*)");
         private Regex compilerErrorRegex = new Regex(@"\s*error[^:]*:\s*(?<message>.*)");
 
+        /// <summary>
+        /// Creates a new compiler process and starts compilation of the provided files.
+        /// </summary>
+        /// <param name="files">Absolute paths to all the C# script files to compile.</param>
+        /// <param name="defines">A set of semi-colon separated defines to provide to the compiler.</param>
+        /// <param name="assemblyFolders">A set of folders containing the assemblies referenced by the script files.</param>
+        /// <param name="assemblies">Names of the assemblies containing code referenced by the script files.</param>
+        /// <param name="debugBuild">Determines should the assembly be compiled with additional debug information.</param>
+        /// <param name="outputFile">Absolute path to the assembly file to generate.</param>
         internal CompilerInstance(string[] files, string defines, string[] assemblyFolders, string[] assemblies,
             bool debugBuild, string outputFile)
         {
@@ -96,6 +190,9 @@ namespace BansheeEditor
             readErrorsThread.Start();
         }
 
+        /// <summary>
+        /// Worker thread method that continually checks for compiler error messages and warnings.
+        /// </summary>
         private void ReadErrorStream()
         {
             while (true)
@@ -124,6 +221,12 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Parses a compiler error or warning message into a more structured format.
+        /// </summary>
+        /// <param name="messageText">Text of the error or warning message.</param>
+        /// <param name="message">Parsed structured version of the message.</param>
+        /// <returns>True if the parsing was completed successfully, false otherwise.</returns>
         private bool TryParseCompilerMessage(string messageText, out CompilerMessage message)
         {
             message = new CompilerMessage();
@@ -157,16 +260,25 @@ namespace BansheeEditor
             return false;
         }
 
+        /// <summary>
+        /// Checks is the compilation process done.
+        /// </summary>
         public bool IsDone
         {
             get { return process.HasExited && readErrorsThread.ThreadState == System.Threading.ThreadState.Stopped; }
         }
 
+        /// <summary>
+        /// Checks has the compilAtion had any errors. Only valid after <see cref="IsDone"/> returns true.
+        /// </summary>
         public bool HasErrors
         {
             get { return IsDone && process.ExitCode != 0; }
         }
 
+        /// <summary>
+        /// Returns all warning messages generated by the compiler.
+        /// </summary>
         public CompilerMessage[] WarningMessages
         {
             get
@@ -178,6 +290,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Returns all error messages generated by the compiler.
+        /// </summary>
         public CompilerMessage[] ErrorMessages
         {
             get
@@ -189,6 +304,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Disposes of the compiler process. Should be called when done when this object instance.
+        /// </summary>
         public void Dispose()
         {
             if (process == null)
@@ -204,81 +322,28 @@ namespace BansheeEditor
         }
     }
 
-    public static class ScriptCompiler
-    {
-        public static CompilerInstance CompileAsync(ScriptAssemblyType type, PlatformType platform, bool debug, string outputDir)
-        {
-            LibraryEntry[] scriptEntries = ProjectLibrary.Search("*", new ResourceType[] { ResourceType.ScriptCode });
-
-            List<string> scriptFiles = new List<string>();
-            for (int i = 0; i < scriptEntries.Length; i++)
-            {
-                if(scriptEntries[i].Type != LibraryEntryType.File)
-                    continue;
-
-                FileEntry fileEntry = (FileEntry)scriptEntries[i];
-
-                ScriptCodeImportOptions io = (ScriptCodeImportOptions) fileEntry.Options;
-                if (io.EditorScript && type == ScriptAssemblyType.Editor ||
-                    !io.EditorScript && type == ScriptAssemblyType.Game)
-                {
-                    scriptFiles.Add(scriptEntries[i].Path);
-                }
-            }
-
-            string[] assemblyFolders;
-            string[] assemblies;
-            string outputFile;
-
-            string[] frameworkAssemblies = BuildManager.GetFrameworkAssemblies(platform);
-            if (type == ScriptAssemblyType.Game)
-            {
-                assemblyFolders = new string[]
-                {
-                    EditorApplication.BuiltinAssemblyPath, 
-                    EditorApplication.FrameworkAssemblyPath
-                };
-
-                assemblies = new string[frameworkAssemblies.Length + 1];
-                assemblies[assemblies.Length - 1] = EditorApplication.EngineAssembly;
-
-                outputFile = Path.Combine(outputDir, EditorApplication.ScriptGameAssembly);
-            }
-            else
-            {
-                assemblyFolders = new string[]
-                {
-                    EditorApplication.BuiltinAssemblyPath, 
-                    EditorApplication.FrameworkAssemblyPath,
-                    EditorApplication.ScriptAssemblyPath
-                };
-
-                assemblies = new string[frameworkAssemblies.Length + 3];
-                assemblies[assemblies.Length - 1] = EditorApplication.EngineAssembly;
-                assemblies[assemblies.Length - 2] = EditorApplication.EditorAssembly;
-                assemblies[assemblies.Length - 3] = EditorApplication.ScriptGameAssembly;
-
-                outputFile = Path.Combine(outputDir, EditorApplication.ScriptEditorAssembly);
-            }
-
-            Array.Copy(frameworkAssemblies, assemblies, frameworkAssemblies.Length);
-
-            string defines = BuildManager.GetDefines(platform);
-            return new CompilerInstance(scriptFiles.ToArray(), defines, assemblyFolders, assemblies, debug, outputFile);
-        }
-    }
-
+    /// <summary>
+    /// Type of messages reported by the script compiler.
+    /// </summary>
     public enum CompilerMessageType
     {
         Warning, Error
     }
 
+    /// <summary>
+    /// Data about a message reported by the compiler.
+    /// </summary>
     public struct CompilerMessage
     {
+        /// <summary>Type of the message.</summary>
         public CompilerMessageType type;
+        /// <summary>Body of the message.</summary>
         public string message;
+        /// <summary>Path ot the file the message is referencing.</summary>
         public string file;
+        /// <summary>Line the message is referencing.</summary>
         public int line;
+        /// <summary>Column the message is referencing.</summary>
         public int column;
     }
 }

+ 57 - 6
MBansheeEditor/Selection.cs

@@ -4,13 +4,34 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Handles scene object and resource selection. Triggeres events when selection changes and allows the user to query
+    /// current selection state.
+    /// </summary>
     public sealed class Selection
     {
+        /// <summary>
+        /// Triggered whenever scene object or resource selection changes. The provided parameters will contain the newly 
+        /// selected objects/resource paths.
+        /// </summary>
         public static Action<SceneObject[], string[]> OnSelectionChanged;
-        public static Action<SceneObject> OnSceneObjectPing;
-        public static Action<string> OnResourcePing;
 
-        public static SceneObject sceneObject
+        /// <summary>
+        /// Triggered when a scene object ping is requested. Ping usually means the object will be highlighted in its 
+        /// respective editors.
+        /// </summary>
+        internal static Action<SceneObject> OnSceneObjectPing;
+
+        /// <summary>
+        /// Triggered when a resource ping is requested. Ping usually means the object will be highlighted in its respective
+        /// editors.
+        /// </summary>
+        internal static Action<string> OnResourcePing;
+
+        /// <summary>
+        /// Currently selected scene object. If more than one object is selected, this returns the first one.
+        /// </summary>
+        public static SceneObject SceneObject
         {
             get
             {
@@ -28,7 +49,10 @@ namespace BansheeEditor
             }
         }
 
-        public static SceneObject[] sceneObjects
+        /// <summary>
+        /// Currently selected set of scene objects.
+        /// </summary>
+        public static SceneObject[] SceneObjects
         {
             get
             {
@@ -42,7 +66,10 @@ namespace BansheeEditor
             }
         }
 
-        public static string[] resourceUUIDs
+        /// <summary>
+        /// Currently selected set of resource UUIDs.
+        /// </summary>
+        public static string[] ResourceUUIDs
         {
             get
             {
@@ -56,7 +83,10 @@ namespace BansheeEditor
             }
         }
 
-        public static string[] resourcePaths
+        /// <summary>
+        /// Currently selected set of resource paths.
+        /// </summary>
+        public static string[] ResourcePaths
         {
             get
             {
@@ -70,6 +100,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Pings the resource, highlighting it in its respective editors.
+        /// </summary>
+        /// <param name="resource">Resource to highlight.</param>
         public static void Ping(Resource resource)
         {
             string path = ProjectLibrary.GetPath(resource);
@@ -77,23 +111,40 @@ namespace BansheeEditor
             Internal_PingResource(path);
         }
 
+        /// <summary>
+        /// Pings the scene object, highlighting it in its respective editors.
+        /// </summary>
+        /// <param name="so">Scene object to highlight.</param>
         public static void Ping(SceneObject so)
         {
             Internal_PingSceneObject(so);
         }
 
+        /// <summary>
+        /// Triggered internally by the runtime when the selection changes.
+        /// </summary>
+        /// <param name="objects">Set of newly selected scene objects.</param>
+        /// <param name="paths">Set of newly selected resource paths.</param>
         private static void Internal_TriggerSelectionChanged(SceneObject[] objects, string[] paths)
         {
             if (OnSelectionChanged != null)
                 OnSelectionChanged(objects, paths);
         }
 
+        /// <summary>
+        /// Triggered internally by the runtime when the scene object ping is triggered.
+        /// </summary>
+        /// <param name="so">Scene object to highlight.</param>
         private static void Internal_TriggerSceneObjectPing(SceneObject so)
         {
             if (OnSceneObjectPing != null)
                 OnSceneObjectPing(so);
         }
 
+        /// <summary>
+        /// Triggered internally by the runtime when the resource ping is triggered.
+        /// </summary>
+        /// <param name="path">Path to the resource to highlight.</param>
         private static void Internal_TriggerResourcePing(string path)
         {
             if (OnResourcePing != null)

+ 65 - 0
MBansheeEditor/UndoRedo.cs

@@ -8,24 +8,45 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Provides functionality to undo or redo recently performed operations in the editor.
+    /// </summary>
     public static class UndoRedo
     {
+        /// <summary>
+        /// Executes the last command on the undo stack, undoing its operations.
+        /// </summary>
         public static void Undo()
         {
             Internal_Undo();
         }
 
+        /// <summary>
+        /// Executes the last command on the redo stack (last command we called undo on), re-applying its operation.
+        /// </summary>
         public static void Redo()
         {
             Internal_Redo();
         }
 
+        /// <summary>
+        /// Records a state of the entire scene object at a specific point and allows you to restore it to its original 
+        /// values as needed.
+        /// </summary>
+        /// <param name="so">Scene object to record.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
         public static void RecordSO(SceneObject so, string description = "")
         {
             if (so != null)
                 Internal_RecordSO(so.GetCachedPtr(), description);
         }
 
+        /// <summary>
+        /// Creates new scene object(s) by cloning existing objects.
+        /// </summary>
+        /// <param name="so">Scene object(s) to clone.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
+        /// <returns>Cloned scene objects.</returns>
         public static SceneObject[] CloneSO(SceneObject[] so, string description = "")
         {
             if (so != null)
@@ -43,6 +64,12 @@ namespace BansheeEditor
             return new SceneObject[0];
         }
 
+        /// <summary>
+        /// Creates new a scene object by cloning an existing object.
+        /// </summary>
+        /// <param name="so">Scene object to clone.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
+        /// <returns>Cloned scene object.</returns>
         public static SceneObject CloneSO(SceneObject so, string description = "")
         {
             if (so != null)
@@ -51,6 +78,12 @@ namespace BansheeEditor
             return null;
         }
 
+        /// <summary>
+        /// Instantiates scene object(s) from a prefab.
+        /// </summary>
+        /// <param name="prefab">Prefab to instantiate.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
+        /// <returns>Instantiated scene object.</returns>
         public static SceneObject Instantiate(Prefab prefab, string description = "")
         {
             if (prefab != null)
@@ -59,17 +92,34 @@ namespace BansheeEditor
             return null;
         }
 
+        /// <summary>
+        /// Creates a new scene object.
+        /// </summary>
+        /// <param name="name">Name of the scene object.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
+        /// <returns>Newly created scene object.</returns>
         public static SceneObject CreateSO(string name, string description = "")
         {
             return Internal_CreateSO(name, description);
         }
 
+        /// <summary>
+        /// Deletes a scene object.
+        /// </summary>
+        /// <param name="so">Scene object to delete.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
         public static void DeleteSO(SceneObject so, string description = "")
         {
             if (so != null)
                 Internal_DeleteSO(so.GetCachedPtr(), description);
         }
 
+        /// <summary>
+        /// Changes the parent of the scene object.
+        /// </summary>
+        /// <param name="so">Scene object to change the parent of.</param>
+        /// <param name="parent">New parent.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
         public static void ReparentSO(SceneObject so, SceneObject parent, string description = "")
         {
             if (so != null)
@@ -82,6 +132,12 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Changes the parent of a set of scene objects.
+        /// </summary>
+        /// <param name="so">Scene objects to change the parent of.</param>
+        /// <param name="parent">New parent.</param>
+        /// <param name="description">Optional description of what exactly the command does.</param>
         public static void ReparentSO(SceneObject[] so, SceneObject parent, string description = "")
         {
             if (so != null)
@@ -104,11 +160,20 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Creates a new undo/redo group. All new commands will be registered to this group. You may remove the group and 
+        /// all of its commands by calling <see cref="PopGroup"/>.
+        /// </summary>
+        /// <param name="name">Unique name of the group.</param>
         public static void PushGroup(string name)
         {
             Internal_PushGroup(name);
         }
 
+        /// <summary>
+        /// Removes all the command registered to the current undo/redo group.
+        /// </summary>
+        /// <param name="name">Unique name of the group.</param>
         public static void PopGroup(string name)
         {
             Internal_PopGroup(name);

+ 18 - 0
MBansheeEditor/UnitTestTypes.cs

@@ -3,6 +3,9 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Helper component used for unit tests.
+    /// </summary>
     public class UT1_Component1 : Component
     {
         public int a;
@@ -24,11 +27,17 @@ namespace BansheeEditor
         public SceneObject otherSO;
     }
 
+    /// <summary>
+    /// Helper component used for unit tests.
+    /// </summary>
     public class UT1_Component2 : Component
     {
         public int a2;
     }
 
+    /// <summary>
+    /// Helper type used for unit tests.
+    /// </summary>
     [SerializeObject]
     public class UT1_SerzCls
     {
@@ -38,6 +47,9 @@ namespace BansheeEditor
         public UT1_SerzCls child;
     }
 
+    /// <summary>
+    /// Helper type used for unit tests.
+    /// </summary>
     [SerializeObject]
     public struct UT1_SerzObj
     {
@@ -51,6 +63,9 @@ namespace BansheeEditor
         public string anotherValue;
     }
 
+    /// <summary>
+    /// Helper type used for unit tests.
+    /// </summary>
     [SerializeObject]
     public class UT_DiffChildObj
     {
@@ -58,6 +73,9 @@ namespace BansheeEditor
         public string plain2 = "oneoone";
     }
 
+    /// <summary>
+    /// Helper type used for unit tests.
+    /// </summary>
     [SerializeObject]
     public class UT_DiffObj
     {

+ 15 - 0
MBansheeEditor/UnitTests.cs

@@ -9,8 +9,14 @@ using DebugUnit = System.Diagnostics.Debug;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Contains various managed unit tests.
+    /// </summary>
     class UnitTests
     {
+        /// <summary>
+        /// Tests managed object serialization and deserialization.
+        /// </summary>
         static void UnitTest1_ManagedSerialization()
         {
             SceneObject otherSO = new SceneObject("OtherSO");
@@ -82,6 +88,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Tests serializable properties used for inspection.
+        /// </summary>
         static void UnitTest2_SerializableProperties()
         {
             SerializableObject obj = new SerializableObject(typeof(UT1_SerzCls), new UT1_SerzCls());
@@ -110,6 +119,9 @@ namespace BansheeEditor
                 Debug.Log("New value: " + prop2.GetValue<UT1_SerzCls>().anotherValue2);
         }
 
+        /// <summary>
+        /// Tests managed diff creation used by prefabs.
+        /// </summary>
         static void UnitTest3_ManagedDiff()
         {
             UT_DiffObj original = new UT_DiffObj();
@@ -201,6 +213,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Runs all tests.
+        /// </summary>
         static void RunTests()
         {
             UnitTest1_ManagedSerialization();

+ 1 - 1
SBansheeEditor/Include/BsScriptProjectLibrary.h

@@ -65,7 +65,7 @@ namespace BansheeEngine
 		static MonoArray* internal_Search(MonoString* pattern, MonoArray* types);
 		static void internal_Delete(MonoString* path);
 		static void internal_CreateFolder(MonoString* path);
-		static void internal_Rename(MonoString* path, MonoString* name);
+		static void internal_Rename(MonoString* path, MonoString* name, bool overwrite);
 		static void internal_Move(MonoString* oldPath, MonoString* newPath, bool overwrite);
 		static void internal_Copy(MonoString* source, MonoString* destination, bool overwrite);
 		static MonoString* internal_GetResourceFolder();

+ 15 - 4
SBansheeEditor/Source/BsScriptProjectLibrary.cpp

@@ -59,6 +59,9 @@ namespace BansheeEngine
 	{
 		Path nativePath = MonoUtil::monoToWString(path);
 
+		if (!nativePath.isAbsolute())
+			nativePath.makeAbsolute(ProjectLibrary::instance().getResourcesFolder());
+
 		Vector<Path> dirtyResources;
 		ProjectLibrary::instance().checkForModifications(nativePath, import, dirtyResources);
 
@@ -211,12 +214,12 @@ namespace BansheeEngine
 		ProjectLibrary::instance().createFolderEntry(folderToCreate);
 	}
 
-	void ScriptProjectLibrary::internal_Rename(MonoString* path, MonoString* name)
+	void ScriptProjectLibrary::internal_Rename(MonoString* path, MonoString* name, bool overwrite)
 	{
 		Path oldPath = MonoUtil::monoToWString(path);
 		Path newPath = oldPath.getParent().append(MonoUtil::monoToWString(name));
 
-		ProjectLibrary::instance().moveEntry(oldPath, newPath, false);
+		ProjectLibrary::instance().moveEntry(oldPath, newPath, overwrite);
 	}
 
 	void ScriptProjectLibrary::internal_Move(MonoString* oldPath, MonoString* newPath, bool overwrite)
@@ -261,13 +264,21 @@ namespace BansheeEngine
 
 	void ScriptProjectLibrary::onEntryAdded(const Path& path)
 	{
-		MonoString* pathStr = MonoUtil::wstringToMono(MonoManager::instance().getDomain(), path.toWString());
+		Path relativePath = path;
+		if (relativePath.isAbsolute())
+			relativePath.makeRelative(ProjectLibrary::instance().getResourcesFolder());
+
+		MonoString* pathStr = MonoUtil::wstringToMono(MonoManager::instance().getDomain(), relativePath.toWString());
 		MonoUtil::invokeThunk(OnEntryAddedThunk, pathStr);
 	}
 
 	void ScriptProjectLibrary::onEntryRemoved(const Path& path)
 	{
-		MonoString* pathStr = MonoUtil::wstringToMono(MonoManager::instance().getDomain(), path.toWString());
+		Path relativePath = path;
+		if (relativePath.isAbsolute())
+			relativePath.makeRelative(ProjectLibrary::instance().getResourcesFolder());
+
+		MonoString* pathStr = MonoUtil::wstringToMono(MonoManager::instance().getDomain(), relativePath.toWString());
 		MonoUtil::invokeThunk(OnEntryRemovedThunk, pathStr);
 	}
 

+ 1 - 2
TODO.txt

@@ -63,7 +63,7 @@ Ribek use:
   - Also add dummy icons to toolbar (Open Project, Save Scene, Undo, Redo, Basic shapes, Camera, Renderable, Lights, Play, Pause, Step)
 
 Other polish:
- - C# interface for Font and SpriteTexture
+ - C# interface for SpriteTexture
  - Add menu items:
   - Edit: Cut/Copy/Paste/Duplicate/Delete(need to make sure it works in Hierarchy, with shortcuts), View/Move/rotate/scale
   - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
@@ -115,7 +115,6 @@ Seriously optional:
 
 Finalizing:
  - Add copyright notices in all files & change license to GPL
- - Documentation
  - Need to generate a proper merge of dev and preview branches
    - Use "git revert --no-commit <COMMITID>..HEAD" to reverse anything on the preview branch that was done after the branch creation, then merge
 ----------------------------------------------------------------------