示例#1
0
        public static void SelectPrefabPaths(PrefabsListTreeView treeView, ref bool showAllPrefabs)
        {
            Elements.MiniBoldLabel(ToolTips.optionsLabel);

            Elements.BeginToolbarHorizontal();
            showAllPrefabs = Elements.ToolbarToggle(ToolTips.showAllPrefabs, showAllPrefabs);
            if (Elements.ToolbarButton(ToolTips.treeViewRefresh))
            {
                treeView.RefreshTreeView(showAllPrefabs);
            }
            Elements.EndToolbarHorizontal();
        }
示例#2
0
        void InitIfNeeded()
        {
            if (!m_Initialized)
            {
                if (treeViewState == null)
                {
                    treeViewState = new TreeViewState();
                }

                bool firstInit   = m_MultiColumnHeaderState == null;
                var  headerState = DefaultMultiColumnHeaderState(multiColumnTreeViewRect.width);
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState);
                }
                m_MultiColumnHeaderState = headerState;

                var multiColumnHeader = new MyMultiColumnHeader(headerState);
                if (firstInit)
                {
                    multiColumnHeader.ResizeToFit();
                }

                var treeModel = new TreeModel <PrefabsListElement>(PrefabsListTreeView.GetPrefabsListElements());

                m_TreeView = new PrefabsListTreeView(treeViewState, multiColumnHeader, treeModel);

                m_SearchField = new SearchField();
                m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem;

                treeView.previewImage = new Texture2D(60, 60);
                treeView.prefabData   = new WorldSerialization.PrefabData()
                {
                    id = 0
                };

                m_Initialized = true;
            }
        }
示例#3
0
 void DrawPrefabPaths(Rect rect, PrefabsListTreeView treeView, ref bool showAllPrefabs)
 {
     GUILayout.BeginArea(rect);
     Functions.SelectPrefabPaths(treeView, ref showAllPrefabs);
     GUILayout.EndArea();
 }