Пример #1
0
        //public bool dragHandleEnabled { get; set; }

        private void InitIfNeeded()
        {
            if (!m_Initialized)
            {
                if (m_TreeViewState == null)
                {
                    m_TreeViewState = new TreeViewState();
                }
                if (m_MultiColumnHeaderState == null)
                {
                    string[] propNames;
                    m_MultiColumnHeaderState = new MultiColumnHeaderState(m_HeaderDelegate(out propNames));
                    m_DataStore = new SerializedPropertyDataStore(propNames, m_GatherDelegate);
                }
                var multiColumnHeader = new MultiColumnHeader(m_MultiColumnHeaderState);
                m_ColumnHeaderHeight = multiColumnHeader.height;
                m_TreeView           = new SerializedPropertyTreeView(m_TreeViewState, multiColumnHeader, m_DataStore);
                m_TreeView.DeserializeState(m_SerializationUID);
                m_TreeView.Reload();
                m_Initialized = true;
            }
        }
        public SerializedPropertyTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader,
                                          SerializedPropertyDataStore dataStore)
            : base(state, multicolumnHeader)
        {
            m_DataStore = dataStore;
            var num = multiColumnHeader.state.columns.Length;

            m_ColumnsInternal = new ColumnInternal[num];
            for (var i = 0; i < num; i++)
            {
                var column = Col(i);
                if (column.propertyName != null)
                {
                    m_ColumnsInternal[i].dependencyProps = new SerializedProperty[column.propertyName.Length];
                }
            }
            multiColumnHeader.sortingChanged        += OnSortingChanged;
            multiColumnHeader.visibleColumnsChanged += OnVisibleColumnChanged;
            showAlternatingRowBackgrounds            = true;
            showBorder = true;
            rowHeight  = EditorGUIUtility.singleLineHeight;
        }