示例#1
0
        protected override void OnEnable()
        {
            base.OnEnable();
            Selection.selectionChanged += OnSelectionChanged;
            _data = BundleBuilder.GetData();
            BundleBuilder.Scan(_data);
            titleContent             = new GUIContent("Bundle Builder");
            _searchKeyword           = EditorPrefs.GetString(KeyForSearchKey);
            _searchSliceKeyword      = EditorPrefs.GetString(KeyForSearchSliceKey);
            _showDefinedOnly         = EditorPrefs.GetInt(KeyForShowDefinedOnly) == 1;
            _showSelectionOnly       = EditorPrefs.GetInt(KeyForShowSelectionOnly) == 1;
            _showStreamingAssetsOnly = EditorPrefs.GetInt(KeyForShowStreamingAssetsOnly) == 1;
            UpdateSearchResults();
            _tabIndex = EditorPrefs.GetInt(KeyForTabIndex);
            _platform = (PackagePlatform)EditorPrefs.GetInt(KeyForPackagePlatforms, (int)PackagePlatform.Any);
            // bool firstInit = _headerState == null;
            var headerState = BundleBuilderTreeView.CreateDefaultMultiColumnHeaderState(this.position.width);

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

            var header = new BundleBuilderTreeViewHeader(headerState);

            _headerState = headerState;

            _treeView = new BundleBuilderTreeView(_treeViewState, header);
            _treeView.SetData(_data);
        }
示例#2
0
        void OnEnable()
        {
            data         = BundleBuilder.GetData();
            titleContent = new GUIContent("Bundle Builder");
            bool firstInit   = _headerState == null;
            var  headerState = BundleBuilderTreeView.CreateDefaultMultiColumnHeaderState(this.position.width);

            if (MultiColumnHeaderState.CanOverwriteSerializedFields(_headerState, headerState))
            {
                MultiColumnHeaderState.OverwriteSerializedFields(_headerState, headerState);
            }
            var header = new BundleBuilderTreeViewHeader(headerState);

            _headerState = headerState;

            _treeView = new BundleBuilderTreeView(_treeViewState, header);
            _treeView.SetData(data);
        }