Exemple #1
0
        private void TreeViewInitialize()
        {
            if (EasyAssetBundleWindow.win == null || EasyAssetBundleWindow.win.SelectedData == null || EasyAssetBundleWindow.win.CurrentConfig == null)
            {
                return;
            }

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

            var headerState = EasyAssetBundleAssetListView.CreateDefaultMultiColumnHeaderState(multiColumnTreeViewRect.width);

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

            var multiColumnHeader = new EasyAssetBundleMultiColumnHeader(headerState);

            multiColumnHeader.ResizeToFit();

            var treeModel = new TreeModel <EditorAssetInfo>(EasyAssetBundleWindow.win.SelectedData.VersionAssets);

            treeView = new EasyAssetBundleAssetListView(treeViewState, multiColumnHeader, treeModel);
            treeView.Initialize((IAssetBundleBuildConfig)EasyAssetBundleWindow.win.CurrentConfig, EasyAssetBundleWindow.win.CurrentConfig.AssetBundleBuildRootPath);
            treeView.showControls = false;
            treeView.ExpandAll();

            SaveAssetBundleListName = EasyAssetBundleWindow.win.SelectedData.CurrentAssetBundleListName;
            allFileSize             = EasyAssetBundleWindow.win.SelectedData.VersionAssets.Sum(a => a.Size);
            allFileNum = EasyAssetBundleWindow.win.SelectedData.VersionAssets.Count - 1;
        }
        private void TreeViewInitialize()
        {
            if (SelectedData == null || SelectedData.BuildAssets == null || SelectedData.BuildAssets.Count == 0 || !SelectedData.Config.IsConfigAvailable)
            {
                treeView = null;
                return;
            }

            SelectedData.Initialize();
            CurrentConfig = SelectedData.CurrentConfig;
            if (CurrentConfig == null)
            {
                treeView = null;
                return;
            }

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

            var headerState = EasyAssetBundleBuildAssetView.CreateDefaultMultiColumnHeaderState(multiColumnTreeViewRect.width, IsUseAssetBundleList);

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

            var multiColumnHeader = new EasyAssetBundleMultiColumnHeader(headerState);

            var treeModel = new TreeModel <EditorAssetInfo>(SelectedData.BuildAssets);

            treeView = new EasyAssetBundleBuildAssetView(treeViewState, multiColumnHeader, treeModel);
            treeView.Initialize(( IAssetBundleBuildConfig )CurrentConfig, CurrentConfig.AssetBundleBuildRootPath);
            treeView.ExpandAll();
            multiColumnHeader.ResizeToFit();
        }