Ejemplo n.º 1
0
        public void DrawFolderContent(GuidObject.Folder folder, bool allowAdding = true)
        {
            Layout.BeginHorizontal();
            DrawFolderHeaderItem(folder);
            Layout.EndHorizontal();

            if (folder.FoldOut)
            {
                Layout.BeginOffset(FoldOffset);

                // subfolders
                if (folder.SubFolders != null)
                {
                    foreach (var subFolder in folder.SubFolders.Values)
                    {
                        DrawFolderContent(subFolder, allowAdding);
                    }
                }

                // items
                if (folder.FullItemCount == 0)
                {
                    Layout.Label("<empty>");
                }
                else
                {
                    foreach (var guidObject in folder.OwnItems)
                    {
                        DrawObjectItem(guidObject);
                    }
                }

                Layout.EndOffset();
            }
        }
Ejemplo n.º 2
0
        private void DrawFolderHeaderItem(GuidObject.Folder folder)
        {
            var caption = String.Format("{0} ({1})", folder.Name, folder.FullItemCount);

            if (folder.SkipCodegen)
            {
                caption += " skip";
            }
            Layout.FoldLine(ref folder.FoldOut, caption, null);

            var rect = GUILayoutUtility.GetLastRect();

            if (rect.Contains(Event.current.mousePosition))
            {
                HoveredObject = folder;
            }
        }
Ejemplo n.º 3
0
 public GameData()
 {
     RootFolder = new GuidObject.Folder("RootFolder");
 }