private void InitIfNeeded()
        {
            if (m_SearchField != null)
            {
                return;
            }

            bool firstInit   = m_MultiColumnHeaderState == null;
            var  headerState = CreateMultiColumnHeader();

            if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState))
            {
                MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState);
            }

            m_MultiColumnHeaderState = headerState;

            var multiColumnHeader = new MultiColumnHeader(headerState);

            if (firstInit)
            {
                multiColumnHeader.ResizeToFit();
            }

            if (m_TreeViewState == null)
            {
                m_TreeViewState = new TreeViewState();
            }

            m_TreeModel = new SpritePackerOverviewTreeModel();
            m_TreeView  = new SpritePackerOverviewTreeView(m_TreeViewState, multiColumnHeader);
            m_TreeView.SetModel(m_TreeModel);

            m_SearchField = new SearchField();
            m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem;
            Refresh();
        }
Пример #2
0
 public void SetModel(SpritePackerOverviewTreeModel model)
 {
     m_TreeModel = model;
 }