public AssetTreeView(TreeViewState state, MultiColumnHeader multiColumnHeader, AssetTreeModel model) : base(state, multiColumnHeader) { m_Model = model; rowHeight = 20f; showAlternatingRowBackgrounds = true; showBorder = true; multiColumnHeader.height = 23f; AssetDanshariWatcher.onImportedAssets += OnWatcherImportedAssets; AssetDanshariWatcher.onDeletedAssets += OnWatcherDeletedAssets; AssetDanshariWatcher.onMovedAssets += OnWatcherMovedAssets; }
public AssetDependenciesTreeView(TreeViewState state, MultiColumnHeader multiColumnHeader, AssetTreeModel model) : base(state, multiColumnHeader, model) { this.model = model as AssetDependenciesTreeModel; AssetDanshariHandler.onDependenciesFindItem += OnDependenciesFindItem; }
public AssetReferenceTreeView(TreeViewState state, MultiColumnHeader multiColumnHeader, AssetTreeModel model) : base(state, multiColumnHeader, model) { this.model = model as AssetReferenceTreeModel; }
private void OnDependenciesLoadDataMore(string resPath, List <AssetTreeModel.AssetInfo> resInfos, AssetTreeModel treeModel) { // 去代码定义文件去查找 if (resPath != "\"Assets/Simple UI/PNG\"") { return; } int preLen = resPath.Length - "PNG".Length - 2; string codePath = "Assets/Demo/UISpriteDefine.cs"; try { string text = File.ReadAllText(codePath); foreach (var assetInfo in resInfos) { string searchText = assetInfo.fileRelativePath.Substring(preLen); searchText = searchText.Remove(searchText.Length - 4); if (text.Contains(searchText)) { AssetTreeModel.AssetInfo info = treeModel.GenAssetInfo(codePath); info.isExtra = true; assetInfo.AddChild(info); } } } catch (Exception ex) { Debug.LogError(ex.Message); } }
protected virtual void InitTree(MultiColumnHeader multiColumnHeader) { m_AssetTreeModel = new AssetTreeModel(); m_AssetTreeView = new AssetTreeView(m_TreeViewState, multiColumnHeader, m_AssetTreeModel); }