// Token: 0x060001AF RID: 431 RVA: 0x0000CA94 File Offset: 0x0000AC94 private List <Object> GetSelectedAssets() { List <Object> list = new List <Object>(); object[] selectedItems = base.SelectedItems; List <Object> result; using (EditorGUI2.ModalProgressBar modalProgressBar = new EditorGUI2.ModalProgressBar("Loading assets...", true)) { for (int i = 0; i < selectedItems.Length; i++) { FindAssetUsage.AssetProxy assetProxy = selectedItems[i] as FindAssetUsage.AssetProxy; if (assetProxy != null) { if (modalProgressBar.TotalElapsedTime > 1f && modalProgressBar.ElapsedTime > 0.1f) { float progress = (float)i / (float)selectedItems.Length; string text = string.Format("[{1} remaining] {0}", assetProxy.Name, selectedItems.Length - i - 1); if (modalProgressBar.Update(text, progress)) { break; } } Object @object = assetProxy.LoadAsset(); if (@object != null) { list.Add(@object); } } } result = list; } return(result); }
// Token: 0x060001A7 RID: 423 RVA: 0x0000C708 File Offset: 0x0000A908 protected override void OnDrawItem(GUIListViewDrawItemArgs args) { FindAssetUsage.AssetProxy assetProxy = args.Model as FindAssetUsage.AssetProxy; if (assetProxy == null) { return; } if (args.Column.IsPrimaryColumn) { Texture texture = null; if (assetProxy.Asset != null) { texture = AssetPreview.GetMiniTypeThumbnail(assetProxy.Asset.GetType()); } else if (assetProxy.AssetType != null) { texture = AssetPreview.GetMiniTypeThumbnail(assetProxy.AssetType); } else if (!string.IsNullOrEmpty(assetProxy.AssetPath)) { texture = AssetPreview.GetMiniTypeThumbnail(AssetDatabase2.GetAssetType(assetProxy.AssetPath)); } if (texture == null) { texture = AssetPreview.GetMiniTypeThumbnail(typeof(TextAsset)); } GUIListView.DrawItemImageHelper(ref args.ItemRect, texture, new Vector2(16f, 16f)); } args.ItemRect.y = args.ItemRect.y + 3f; args.ItemRect.height = args.ItemRect.height - 3f; FindAssetUsageWindow.Listbox.Column column = args.Column as FindAssetUsageWindow.Listbox.Column; column.DrawFunc(assetProxy, args); }
// Token: 0x0600019F RID: 415 RVA: 0x0000C5C4 File Offset: 0x0000A7C4 public void SelectItem(int index) { FindAssetUsage.AssetProxy assetProxy = this.OnGetItem(index) as FindAssetUsage.AssetProxy; base.SelectedItems = new FindAssetUsage.AssetProxy[] { assetProxy }; }
// Token: 0x06000195 RID: 405 RVA: 0x0000C270 File Offset: 0x0000A470 private void Init() { if (this._result == null) { this._result = new FindAssetUsage.Result(); } this._searchfor = new FindAssetUsageWindow.LeftListbox(this, null); if (!string.IsNullOrEmpty(this._productId)) { this._searchfor.EditorPrefsPath = string.Format("{0}.FindAssetUsage.ListView1", this._productId); this._searchfor.LoadPrefs(); } List <FindAssetUsage.AssetProxy> list = new List <FindAssetUsage.AssetProxy>(); foreach (FindAssetUsage.ResultEntry item in this._result.Entries) { list.Add(item); } this._searchfor.SetItems(list); this._searchfor.SelectionChange = delegate(GUIListView sender) { Dictionary <FindAssetUsage.AssetProxy, FindAssetUsage.AssetProxy> dictionary = new Dictionary <FindAssetUsage.AssetProxy, FindAssetUsage.AssetProxy>(); foreach (object objB in this._searchfor.SelectedItems) { foreach (FindAssetUsage.ResultEntry resultEntry in this._result.Entries) { if (object.ReferenceEquals(resultEntry, objB)) { foreach (FindAssetUsage.AssetProxy assetProxy in resultEntry.Findings) { dictionary[assetProxy] = assetProxy; } } } } FindAssetUsage.AssetProxy[] array = new FindAssetUsage.AssetProxy[dictionary.Keys.Count]; int count = dictionary.Keys.Count; dictionary.Keys.CopyTo(array, 0); this._searchresult.SetItems(array); }; this._searchresult = new FindAssetUsageWindow.RightListbox(this, null); if (!string.IsNullOrEmpty(this._productId)) { this._searchresult.EditorPrefsPath = string.Format("{0}.FindAssetUsage.ListView2", this._productId); this._searchresult.LoadPrefs(); } this._splitterWidth = EditorPrefs.GetFloat(string.Format("{0}.FindAssetUsage.SplitterWidth", this._productId), 300f); if (this._result.Entries.Count > 0) { this._searchfor.SelectItem(0); } }
// Token: 0x060001A8 RID: 424 RVA: 0x0000C810 File Offset: 0x0000AA10 protected override void OnItemContextMenu(GUIListViewContextMenuArgs args) { base.OnItemContextMenu(args); if (base.SelectedItemsCount < 1) { return; } FindAssetUsage.AssetProxy assetProxy = args.Model as FindAssetUsage.AssetProxy; bool flag = FileUtil2.Exists(assetProxy.AssetPath); GenericMenu genericMenu = new GenericMenu(); genericMenu.AddItem(new GUIContent((Application.platform == null) ? "Reveal in Finder" : "Show in Explorer"), false, flag ? new GenericMenu.MenuFunction(this.OnContextMenuShowInExplorer) : null); genericMenu.AddItem(new GUIContent("Open %enter"), false, FileUtil2.Exists(assetProxy.AssetPath) ? new GenericMenu.MenuFunction(this.OnContextMenuOpenWithDefaultApp) : null); genericMenu.AddItem(new GUIContent(string.Empty), false, null); genericMenu.AddItem(new GUIContent("Select in Project _enter"), false, flag ? new GenericMenu.MenuFunction(this.OnContextMenuSelect) : null); genericMenu.AddItem(new GUIContent("Find References in Scene"), false, (base.SelectedItemsCount == 1) ? new GenericMenu.MenuFunction(this.OnContextMenuFindReferencesInScene) : null); genericMenu.AddItem(new GUIContent(string.Empty), false, null); genericMenu.AddItem(new GUIContent("Copy Full Path"), false, flag ? new GenericMenu.MenuFunction(this.OnContextMenuCopyFullPath) : null); genericMenu.DropDown(new Rect(args.MenuLocation.x, args.MenuLocation.y, 0f, 0f)); Event.current.Use(); base.Editor.Repaint(); }
// Token: 0x060001AE RID: 430 RVA: 0x0000CA28 File Offset: 0x0000AC28 private List <string> GetSelectedPaths() { List <string> list = new List <string>(); object[] selectedItems = base.SelectedItems; for (int i = 0; i < selectedItems.Length; i++) { FindAssetUsage.AssetProxy assetProxy = selectedItems[i] as FindAssetUsage.AssetProxy; if (assetProxy != null) { string assetPath = assetProxy.AssetPath; if (assetProxy.Asset != null) { assetPath = AssetDatabase.GetAssetPath(assetProxy.Asset); } if (!string.IsNullOrEmpty(assetPath)) { list.Add(assetPath); } } } return(list); }
// Token: 0x060001B6 RID: 438 RVA: 0x0000CC1C File Offset: 0x0000AE1C protected void OnDrawFindingsCount(FindAssetUsage.AssetProxy m, GUIListViewDrawItemArgs args) { FindAssetUsage.ResultEntry resultEntry = m as FindAssetUsage.ResultEntry; GUI.Label(args.ItemRect, resultEntry.Findings.Count.ToString(), args.Selected ? EditorStyles.whiteLabel : EditorStyles.label); }
// Token: 0x0600019E RID: 414 RVA: 0x0000C594 File Offset: 0x0000A794 protected int OnCompareAssetPath(object x, object y) { FindAssetUsage.AssetProxy assetProxy = x as FindAssetUsage.AssetProxy; FindAssetUsage.AssetProxy assetProxy2 = y as FindAssetUsage.AssetProxy; return(string.Compare(assetProxy.AssetPath, assetProxy2.AssetPath, StringComparison.OrdinalIgnoreCase)); }
// Token: 0x0600019D RID: 413 RVA: 0x0000C56D File Offset: 0x0000A76D protected void OnDrawAssetPath(FindAssetUsage.AssetProxy model, GUIListViewDrawItemArgs args) { EditorGUI2.PathLabel(args.ItemRect, model.AssetPath ?? "<no path available>", args.Selected); }
// Token: 0x0600019B RID: 411 RVA: 0x0000C524 File Offset: 0x0000A724 protected void OnDrawAssetName(FindAssetUsage.AssetProxy model, GUIListViewDrawItemArgs args) { EditorGUI2.PathLabel(args.ItemRect, model.Name, args.Selected); }
// Token: 0x0600018D RID: 397 RVA: 0x0000C064 File Offset: 0x0000A264 public void Add(Object obj) { FindAssetUsage.AssetProxy assetProxy = new FindAssetUsage.AssetProxy(); assetProxy.Asset = obj; this.Findings.Add(assetProxy); }
// Token: 0x0600018C RID: 396 RVA: 0x0000C03C File Offset: 0x0000A23C public void Add(string path) { FindAssetUsage.AssetProxy assetProxy = new FindAssetUsage.AssetProxy(); assetProxy.AssetPath = path; this.Findings.Add(assetProxy); }