Пример #1
0
 public AssetListTree(TreeViewState state, MultiColumnHeaderState mchs, AssetBundleManageTab ctrl) : base(state, new MultiColumnHeader(mchs))
 {
     m_Controller = ctrl;
     showBorder   = true;
     showAlternatingRowBackgrounds     = true;
     DefaultStyles.label.richText      = true;
     multiColumnHeader.sortingChanged += OnSortingChanged;
 }
Пример #2
0
 public GroupAssetListTree(GroupViewController parent, TreeViewState state, MultiColumnHeaderState mchs) : base(state, new MultiColumnHeader(mchs))
 {
     m_controller = parent;
     showBorder   = true;
     showAlternatingRowBackgrounds = true;
     //DefaultStyles.label.richText = true;
     multiColumnHeader.sortingChanged += OnSortingChanged;
 }
Пример #3
0
        public AssetsBundleAssetsTree(TreeViewState state, MultiColumnHeaderState multiColumnHeader) :
            base(state, new MultiColumnHeader(multiColumnHeader))
        {
            showBorder = true;
            showAlternatingRowBackgrounds = true;

            Reload();
        }
Пример #4
0
 public ModularDetailTreeView(TreeViewState state, MultiColumnHeaderState headerState) : base(state, new MultiColumnHeader(headerState))
 {
     showBorder = true;
     showAlternatingRowBackgrounds     = true;
     columnIndexForTreeFoldouts        = 1;
     m_UnconformedTexture              = EditorGUIUtility.FindTexture("LookDevClose@2x");
     multiColumnHeader.sortingChanged += OnSortingChanged;
 }
            MultiColumnHeaderState CreateDefaultMultiColumnHeaderState()
            {
                var columns = new[]
                {
                    new MultiColumnHeaderState.Column
                    {
                        headerContent         = (m_Type == CallsTreeView.Type.Callers ? Styles.callersLabel : Styles.calleesLabel),
                        headerTextAlignment   = TextAlignment.Left,
                        sortedAscending       = true,
                        sortingArrowAlignment = TextAlignment.Center,
                        width      = 150, minWidth = 150,
                        autoResize = true, allowToggleVisibility = false
                    },
                    new MultiColumnHeaderState.Column
                    {
                        headerContent         = Styles.callsLabel,
                        headerTextAlignment   = TextAlignment.Left,
                        sortedAscending       = false,
                        sortingArrowAlignment = TextAlignment.Right,
                        width      = 60, minWidth = 60,
                        autoResize = false, allowToggleVisibility = true
                    },
                    new MultiColumnHeaderState.Column
                    {
                        headerContent         = Styles.gcAllocLabel,
                        headerTextAlignment   = TextAlignment.Left,
                        sortedAscending       = false,
                        sortingArrowAlignment = TextAlignment.Right,
                        width      = 60, minWidth = 60,
                        autoResize = false, allowToggleVisibility = true
                    },
                    new MultiColumnHeaderState.Column
                    {
                        headerContent         = (m_Type == CallsTreeView.Type.Callers ? Styles.timeMsCallersLabel : Styles.timeMsCalleesLabel),
                        headerTextAlignment   = TextAlignment.Left,
                        sortedAscending       = false,
                        sortingArrowAlignment = TextAlignment.Right,
                        width      = 60, minWidth = 60,
                        autoResize = false, allowToggleVisibility = true
                    },
                    new MultiColumnHeaderState.Column
                    {
                        headerContent         = (m_Type == CallsTreeView.Type.Callers ? Styles.timePctCallersLabel : Styles.timePctCalleesLabel),
                        headerTextAlignment   = TextAlignment.Left,
                        sortedAscending       = false,
                        sortingArrowAlignment = TextAlignment.Right,
                        width      = 60, minWidth = 60,
                        autoResize = false, allowToggleVisibility = true
                    },
                };

                var state = new MultiColumnHeaderState(columns)
                {
                    sortedColumnIndex = (int)CallsTreeView.Column.TimeMs
                };

                return(state);
            }
        void OnGUI()
        {
            switch (state)
            {
            case State.Uninitialized:
                act = FixRule;
                GatherAssetRules();
                state = State.GatheringRules;
                break;

            case State.GatheringRules:
                if (gatherAssetsComplete)
                {
                    GatherData();
                    state = State.GatheringData;
                }
                break;

            case State.GatheringData:
                if (gatherDataComplete)
                {
                    // Check if it already exists (deserialized from window layout file or scriptable object)
                    if (m_TreeViewState == null)
                    {
                        m_TreeViewState = new TreeViewState();
                    }

                    var headerState =
                        AssetAuditTreeView.CreateDefaultMultiColumnHeaderState(multiColumnTreeViewRect.width);
                    if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState))
                    {
                        MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState);
                    }
                    m_MultiColumnHeaderState = headerState;

                    var multiColumnHeader = new MultiColumnHeader(headerState);
                    var treeModel         = new TreeModel <AssetAuditTreeElement>(elements);
                    m_TreeView = new AssetAuditTreeView(m_TreeViewState, multiColumnHeader, treeModel, act);
                    GUILayout.Label(" no asset rules have been found in the project");

                    state = State.Initialized;
                }
                break;

            case State.Initialized:
                DoRuleSelectionGUI();
                SearchBar(toolbarRect);
                DoTreeView(multiColumnTreeViewRect);
                BottomToolBar(bottomToolbarRect);
                break;

            case State.NoAssetRules:
                DoNoAssetRuleGUI();
                break;
            }

            DoProgressBar(progressBarRect);
        }
Пример #7
0
    //生成ColumnHeader
    public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth)
    {
        var columns = new[]
        {
            //图标+名称
            new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent("Name"),
                headerTextAlignment = TextAlignment.Center,
                sortedAscending     = false,
                width                 = 200,
                minWidth              = 60,
                autoResize            = false,
                allowToggleVisibility = false,
                canSort               = false
            },
            //路径
            new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent("Path"),
                headerTextAlignment = TextAlignment.Center,
                sortedAscending     = false,
                width                 = 360,
                minWidth              = 60,
                autoResize            = false,
                allowToggleVisibility = false,
                canSort               = false
            },
            //状态
            new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent("State"),
                headerTextAlignment = TextAlignment.Center,
                sortedAscending     = false,
                width                 = 60,
                minWidth              = 60,
                autoResize            = false,
                allowToggleVisibility = true,
                canSort               = false
            },

            //资源类型
            new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent("Type"),
                headerTextAlignment = TextAlignment.Center,
                sortedAscending     = false,
                width                 = 30,
                minWidth              = 60,
                autoResize            = false,
                allowToggleVisibility = true,
                canSort               = false
            },
        };
        var state = new MultiColumnHeaderState(columns);

        return(state);
    }
Пример #8
0
        public static MultiColumnHeaderState DefaultMultiColumnHeaderState(float treeViewWidth)
        {
            var columns = new[]
            {
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyName,
                    width                 = 60,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyWidth,
                    width                 = 45,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyInnerPadding,
                    width                 = 45,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyOuterPadding,
                    width                 = 45,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyInnerFade,
                    width                 = 45,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = ToolTips.pathHierachyOuterFade,
                    width                 = 45,
                    minWidth              = 40,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
            };

            var state = new MultiColumnHeaderState(columns);

            return(state);
        }
Пример #9
0
        public void OnGUI()
        {
            if (m_DepEntriesMap == null)
            {
                return;
            }
            Rect contentRect = new Rect(0, 0, position.width, position.height - 50);

            if (m_Tree == null)
            {
                if (m_TreeState == null)
                {
                    m_TreeState = new TreeViewState();
                }

                var headerState = ContentUpdateTreeView.CreateDefaultMultiColumnHeaderState();
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_Mchs, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(m_Mchs, headerState);
                }
                m_Mchs = headerState;

                m_Tree = new ContentUpdateTreeView(this, m_TreeState, m_Mchs);
                m_Tree.Reload();
            }

            if (m_DepEntriesMap.Count == 0)
            {
                GUILayout.BeginArea(contentRect);
                GUILayout.BeginVertical();

                GUILayout.Label("No Addressable groups with a BundledAssetGroupSchema and ContentUpdateGroupSchema (with StaticContent enabled) appear to have been modified.");

                GUILayout.EndVertical();
                GUILayout.EndArea();
            }
            else
            {
                m_Tree.OnGUI(contentRect);
            }

            GUILayout.BeginArea(new Rect(0, position.height - 50, position.width, 50));
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Cancel"))
            {
                Close();
            }
            using (new EditorGUI.DisabledScope(m_Tree.GetEnabledEntries().Count == 0))
            {
                if (GUILayout.Button("Apply Changes"))
                {
                    ContentUpdateScript.CreateContentUpdateGroup(m_Settings, m_Tree.GetEnabledEntries(), "Content Update");
                    Close();
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }
Пример #10
0
        protected override VisibilityToolColumnHeader SetupToolColumnHeader()
        {
            var columns = new MultiColumnHeaderState.Column[4];

            columns[0] = new MultiColumnHeaderState.Column
            {
                headerContent       = VisibilityTreeViewBase.VisibilityIconStyle.visibilityOnIcon,
                headerTextAlignment = TextAlignment.Center,
                width                 = 32,
                minWidth              = 32,
                maxWidth              = 32,
                autoResize            = false,
                allowToggleVisibility = true
            };
            columns[1] = new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent(TextContent.bone),
                headerTextAlignment = TextAlignment.Center,
                width                 = 130,
                minWidth              = 130,
                autoResize            = true,
                allowToggleVisibility = false
            };

            columns[2] = new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent(TextContent.depth),
                headerTextAlignment = TextAlignment.Center,
                width                 = 50,
                minWidth              = 50,
                maxWidth              = 50,
                autoResize            = true,
                allowToggleVisibility = true
            };

            columns[3] = new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent(TextContent.color),
                headerTextAlignment = TextAlignment.Center,
                width                 = 50,
                minWidth              = 50,
                maxWidth              = 50,
                autoResize            = true,
                allowToggleVisibility = true
            };

            var multiColumnHeaderState = new MultiColumnHeaderState(columns);

            return(new VisibilityToolColumnHeader(multiColumnHeaderState)
            {
                GetAllVisibility = GetAllVisibility,
                SetAllVisibility = SetAllVisibility,
                canSort = false,
                height = 20,
                visibilityColumn = 0
            });
        }
 public EditorTable(TreeViewState state, MultiColumnHeaderState mchs, bool selectedObjects = false) : base(state, new MultiColumnHeader(mchs))
 {
     showBorder                        = true;
     m_SelectedObjects                 = selectedObjects;
     showAlternatingRowBackgrounds     = true;
     multiColumnHeader.sortingChanged += OnSortingChanged;
     m_RootItem                        = new EditorTableItem();
     m_RootItem.children               = new List <TreeViewItem>();
 }
 public RemoteAssetBundleTreeView(TreeViewState treeViewState, MultiColumnHeaderState header, RemoteAssetBundleManifest manifest, string AppName) : base(treeViewState, new MultiColumnHeader(header))
 {
     Manifest  = manifest;
     rowHeight = 20;
     columnIndexForTreeFoldouts    = 2;
     showAlternatingRowBackgrounds = true;
     showBorder = true;
     Reload();
 }
Пример #13
0
        private static MultiColumnHeader BuilMultiColumnHeader(out MultiColumnHeaderState headerState)
        {
            headerState = BuildColumnHeaderState();
            var multiColumnHeader = new MultiColumnHeader(headerState);

            multiColumnHeader.ResizeToFit();
            multiColumnHeader.height = 18;
            return(multiColumnHeader);
        }
 internal PendingChangesMultiColumnHeader(
     PendingChangesTreeView treeView,
     MultiColumnHeaderState headerState,
     UnityPendingChangesTree tree)
     : base(headerState)
 {
     mPendingChangesTreeView = treeView;
     mPendingChangesTree     = tree;
 }
Пример #15
0
        private MultiColumnHeaderState CreateDefaultMultiColumnHeaderState()
        {
            MultiColumnHeaderState.Column[] columns = CreateColumns();
            Assert.AreEqual(columns.Length, Enum.GetValues(typeof(TColumns)).Length, "Number of columns should match number of enum values: You probably forgot to update one of them.");

            MultiColumnHeaderState state = new MultiColumnHeaderState(columns);

            return(state);
        }
Пример #16
0
        public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth)
        {
            var columnList = new List <MultiColumnHeaderState.Column>();

            HeaderData[] headerData = new HeaderData[]
            {
                new HeaderData("Index", "Order of execution of markers", 30),
                new HeaderData("Filename", "Filename", 250, 100, true, false),
                new HeaderData("Type", "Access type", 60),
                new HeaderData("Access Size", "Size read or written during the file access", 60),
                new HeaderData("Offset", "Offset of the file access", 60),
                new HeaderData("Duration (ms)", "Marker duration (ms)", 60),
                new HeaderData("Avg Bandwidth (MBps)", "The average rate of data transfer for this file access", 60),
                new HeaderData("First Frame Index", "The index of the first frame this access appears on", 60),
                new HeaderData("Frames", "This frame in the Frames covered by this File Access", 60),
                new HeaderData("Thread", "Thread name", 100),
                new HeaderData("Timestamp", "Time marker started from Start", 60),
            };
            foreach (var header in headerData)
            {
                columnList.Add(new MultiColumnHeaderState.Column
                {
                    headerContent         = header.content,
                    headerTextAlignment   = TextAlignment.Left,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Left,
                    width                 = header.width,
                    minWidth              = header.minWidth,
                    autoResize            = header.autoResize,
                    allowToggleVisibility = header.allowToggleVisibility
                });
            }
            ;
            var columns = columnList.ToArray();

            Assert.AreEqual(columns.Length, Enum.GetValues(typeof(FileIOColumns)).Length, "Number of columns should match number of enum values: You probably forgot to update one of them.");

            var state = new MultiColumnHeaderState(columns);

            // Reordering this changes the order they appear in
            state.visibleColumns = new int[]
            {
                (int)FileIOColumns.Index,
                (int)FileIOColumns.Filename,
                (int)FileIOColumns.Type,
                (int)FileIOColumns.SizeBytes,
                (int)FileIOColumns.OffsetBytes,
                (int)FileIOColumns.Duration,
                (int)FileIOColumns.Bandwidth,
                (int)FileIOColumns.FirstFrameIndex,
                (int)FileIOColumns.Frames,
                (int)FileIOColumns.ThreadName,
                //(int)FileIOColumns.Timestamp,
            };

            return(state);
        }
Пример #17
0
        public AddressableAssetEntryTreeView(TreeViewState state, MultiColumnHeaderState mchs, AddressableAssetsSettingsGroupEditor ed) : base(state, new MultiColumnHeader(mchs))
        {
            showBorder = true;
            m_Editor   = ed;
            columnIndexForTreeFoldouts        = 0;
            multiColumnHeader.sortingChanged += OnSortingChanged;

            BuiltinSceneCache.sceneListChanged += OnScenesChanged;
        }
Пример #18
0
 public ResAssetsTreeEitor(TreeViewState state, MultiColumnHeaderState mchs, AssetGroupMgr ctrl)
     : base(state, new MultiColumnHeader(mchs))
 {
     mController = ctrl;
     showBorder  = true;
     showAlternatingRowBackgrounds = true;
     DefaultStyles.label.richText  = true;
     Reload();
 }
        public SpriteVisibilityToolView()
        {
            var columns = new MultiColumnHeaderState.Column[4];

            columns[0] = new MultiColumnHeaderState.Column
            {
                headerContent       = VisibilityTreeViewBase.VisibilityIconStyle.visibilityOnIcon,
                headerTextAlignment = TextAlignment.Center,
                width                 = 32,
                minWidth              = 32,
                maxWidth              = 32,
                autoResize            = false,
                allowToggleVisibility = true
            };
            columns[1] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.name),
                headerTextAlignment = TextAlignment.Center,
                width                 = 130,
                minWidth              = 100,
                autoResize            = true,
                allowToggleVisibility = false
            };
            columns[2] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.category),
                headerTextAlignment = TextAlignment.Center,
                width                 = 70,
                minWidth              = 50,
                autoResize            = true,
                allowToggleVisibility = false
            };
            columns[3] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.label),
                headerTextAlignment = TextAlignment.Center,
                width                 = 50,
                minWidth              = 30,
                autoResize            = true,
                allowToggleVisibility = false
            };
            var multiColumnHeaderState = new MultiColumnHeaderState(columns);
            var multiColumnHeader      = new VisibilityToolColumnHeader(multiColumnHeaderState)
            {
                GetAllVisibility = InternalGetAllVisibility,
                SetAllVisibility = InternalSetAllVisibility,
                canSort          = false,
                height           = 20,
                visibilityColumn = 0
            };

            m_TreeView = new SpriteTreeView(m_TreeViewState, multiColumnHeader)
            {
                GetController = InternalGetController
            };
            SetupSearchField();
        }
        private static MultiColumnHeaderState BuildColumnHeaderState()
        {
            var columns = new[]
            {
                new MultiColumnHeaderState.Column
                {
                    headerContent         = new GUIContent("Entities"),
                    headerTextAlignment   = TextAlignment.Left,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Right,
                    //    //width                 = 90,
                    //    //minWidth              = 90,
                    autoResize            = false,
                    allowToggleVisibility = false
                }
                //These have been left in for the possibility of adding buttons later
                //new MultiColumnHeaderState.Column
                //{
                //    headerContent         = new GUIContent("Duplicate", "Create a copy of this entity on selected world."),
                //    headerTextAlignment   = TextAlignment.Left,
                //    sortedAscending       = true,
                //    sortingArrowAlignment = TextAlignment.Right,
                //    //width                 = 90,
                //    //minWidth              = 90,
                //    autoResize            = false,
                //    allowToggleVisibility = false
                //},
                //new MultiColumnHeaderState.Column
                //{
                //This will require get from type variable overload for all the different GetComponentDatas
                //or an extension method using reflection.
                //    headerContent         = new GUIContent("Copy to World", "Copy this entity to selected world."),
                //    headerTextAlignment   = TextAlignment.Left,
                //    sortedAscending       = true,
                //    sortingArrowAlignment = TextAlignment.Right,
                //    //width                 = 90,
                //    //minWidth              = 90,
                //    autoResize            = false,
                //    allowToggleVisibility = false
                //},
                //new MultiColumnHeaderState.Column
                //{
                //    headerContent         = new GUIContent("Destroy", "Destroy selected entity."),
                //    headerTextAlignment   = TextAlignment.Left,
                //    sortedAscending       = true,
                //    sortingArrowAlignment = TextAlignment.Right,
                //    //width                 = 90,
                //    //minWidth              = 90,
                //    autoResize            = false,
                //    allowToggleVisibility = false
                //}
            };
            var multiColumnHeaderState = new MultiColumnHeaderState(columns);

            return(multiColumnHeaderState);
        }
Пример #21
0
        //------------------------------------------------------------------------/
        // CTOR
        //------------------------------------------------------------------------/
        public MultiColumnTreeView(TreeViewState state, IList <TreeElementType> data)
            : base(state, new TreeModel <TreeElementType>(data))
        {
            this.columns = this.BuildColumns();
            MultiColumnHeaderState headerState = BuildMultiColumnHeaderState(this.columns);

            this.multiColumnHeader = this.stratusMultiColumnHeader = new StratusMultiColumnHeader(headerState);
            this.InitializeMultiColumnTreeView();
            //this.Reload();
        }
Пример #22
0
        public MultiColumnTreeView(TreeViewState state, TreeModel <TreeElementType> model)
            : base(state, model)
        {
            this.columns = this.BuildColumns();
            MultiColumnHeaderState headerState = BuildMultiColumnHeaderState(columns);

            this.multiColumnHeader = new StratusMultiColumnHeader(headerState);
            this.InitializeMultiColumnTreeView();
            //this.Reload();
        }
Пример #23
0
        public static SignalReceiverHeader CreateHeader(MultiColumnHeaderState state, int columnHeight)
        {
            var header = new SignalReceiverHeader(state)
            {
                height = columnHeight
            };

            header.ResizeToFit();
            return(header);
        }
Пример #24
0
 internal EventGraphListView(Func <EventDataSet> dsFunc, TreeViewState tvs, MultiColumnHeaderState mchs, Func <string, bool> filter, IComparer <EventDataSet> dsComparer) : base(tvs, new MultiColumnHeader(mchs))
 {
     m_GetRootDataSetAction     = dsFunc;
     showBorder                 = true;
     visibleStartTime           = 0;
     visibleDuration            = 300;
     m_DataSetComparer          = dsComparer;
     m_FilterFunc               = filter;
     columnIndexForTreeFoldouts = 1;
 }
Пример #25
0
        public GroupViewContext()
        {
            groupListTreeState   = new TreeViewState();
            assetListTreeState   = new TreeViewState();
            groupListHeaderState = GroupListTree.CreateDefaultMultiColumnHeaderState();
            assetListHeaderState = GroupAssetListTree.CreateDefaultMultiColumnHeaderState();

            groupListTreeRect = new Rect(0f, 0f, 300f, 100f);
            assetListTreeRect = new Rect(0f, 0f, 300f, 120f);
        }
Пример #26
0
        public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth)
        {
            var columns = new[]
            {
                new MultiColumnHeaderState.Column
                {
                    headerContent         = new GUIContent("Name"),
                    headerTextAlignment   = TextAlignment.Left,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Center,
                    width                 = 150,
                    minWidth              = 60,
                    autoResize            = false,
                    allowToggleVisibility = false
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = new GUIContent("功能", "是否是功能控件."),
                    headerTextAlignment   = TextAlignment.Right,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Left,
                    width      = 40,
                    minWidth   = 20,
                    autoResize = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = new GUIContent("层级", "视觉曾今[0,..),同一层级会尝试合并"),
                    headerTextAlignment   = TextAlignment.Right,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Left,
                    width                 = 40,
                    minWidth              = 20,
                    autoResize            = true,
                    allowToggleVisibility = true
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent         = new GUIContent("当前深度", "当前深度值"),
                    headerTextAlignment   = TextAlignment.Right,
                    sortedAscending       = true,
                    sortingArrowAlignment = TextAlignment.Left,
                    width                 = 40,
                    minWidth              = 20,
                    autoResize            = true,
                    allowToggleVisibility = true
                }
            };

            Assert.AreEqual(columns.Length, Enum.GetValues(typeof(CustomColumns)).Length, "Number of columns should match number of enum values: You probably forgot to update one of them.");

            var state = new MultiColumnHeaderState(columns);

            return(state);
        }
Пример #27
0
        public void CreateFileSummaryTable()
        {
            m_FileSummaryTreeViewState          = new TreeViewState();
            m_FileSummaryMulticolumnHeaderState = FileSummaryTreeView.CreateDefaultMultiColumnHeaderState(700);

            m_FileSummaryMultiColumnHeader = new MultiColumnHeader(m_FileSummaryMulticolumnHeaderState);
            m_FileSummaryMultiColumnHeader.SetSorting((int)FileSummaryTreeView.SummaryColumns.TotalBytesRead, false);
            m_FileSummaryMultiColumnHeader.ResizeToFit();

            m_FileSummaryTableIsCreated = true;
        }
Пример #28
0
        void EnableHorizontalScrollbar()
        {
            mHorizontalColumn            = new MultiColumnHeaderState.Column();
            mHorizontalColumn.autoResize = false;

            MultiColumnHeaderState.Column[] cols        = { mHorizontalColumn };
            MultiColumnHeaderState          headerState = new MultiColumnHeaderState(cols);

            multiColumnHeader        = new MultiColumnHeader(headerState);
            multiColumnHeader.height = 0f;
        }
Пример #29
0
        public AssetProcessEventLogViewController()
        {
            m_assetLogListTreeState   = new TreeViewState();
            m_assetLogListHeaderState = AssetProcessEventListTree.CreateDefaultMultiColumnHeaderState();

            m_assetLogListTreeRect = new Rect(0f, 0f, 300f, 300f);
            m_detailRect           = new Rect(0f, 0f, 300f, 180f);
            m_assetLogListTree     = new AssetProcessEventListTree(this, m_assetLogListTreeState, m_assetLogListHeaderState);

            m_detailViewResize = new ResizeContext();
        }
Пример #30
0
        void OnGUI()
        {
            if (m_bundleTree == null)
            {
                if (m_selectionTreeState == null)
                {
                    m_selectionTreeState = new TreeViewState();
                }
                m_selectionList = new SelectionListTree(m_selectionTreeState);
                m_selectionList.Reload();

                if (m_assetListState == null)
                {
                    m_assetListState    = new TreeViewState();
                    m_assetListMCHState = new MultiColumnHeaderState(AssetListTree.GetColumns());
                }
                m_assetList = new AssetListTree(m_assetListState, m_assetListMCHState, m_selectionList);
                m_assetList.Reload();


                if (m_bundleTreeState == null)
                {
                    m_bundleTreeState = new TreeViewState();
                }
                m_bundleTree = new AssetBundleTree(m_bundleTreeState, m_assetList);
                m_bundleTree.Refresh();
                Repaint();
            }

            HandleHorizontalResize();
            HandleVerticalResize();

            if (GUI.Button(new Rect(0, kToolbarHeight, m_horizontalSplitterRect.x / 2, 25), new GUIContent("New Bundle")))
            {
                AssetBundleState.GetBundle(null);
            }
            // if (GUI.Button(new Rect(m_horizontalSplitterRect.x / 2, kToolbarHeight, m_horizontalSplitterRect.x / 2, 25), new GUIContent("New Folder")))
            //    ;// m_bundleTree.Add
            //    if (GUI.Button(new Rect(m_horizontalSplitterRect.x / 2, kToolbarHeight, m_horizontalSplitterRect.x/2, 25), new GUIContent("RESET")))
            //        AssetBundleState.Rebuild();

            m_bundleTree.OnGUI(new Rect(0, kToolbarHeight + 25 + kSplitterWidth, m_horizontalSplitterRect.x, position.height - (kToolbarHeight * 2 + kSplitterWidth * 2 + 25)));
            float panelLeft   = m_horizontalSplitterRect.x + kSplitterWidth;
            float panelWidth  = (position.width - m_horizontalSplitterRect.x) - kSplitterWidth * 2;
            float panelHeight = m_verticalSplitterRect.y - kToolbarHeight;

            m_assetList.OnGUI(new Rect(panelLeft, kToolbarHeight, panelWidth, panelHeight));
            m_selectionList.OnGUI(new Rect(panelLeft, m_verticalSplitterRect.y + kSplitterWidth, panelWidth, (position.height - m_verticalSplitterRect.y) - kSplitterWidth * 2));

            if (m_resizingHorizontalSplitter || m_resizingVerticalSplitter)
            {
                Repaint();
            }
        }