internal static void Show(string folder, string currentSubFolder, Rect activatorRect, ProjectBrowser caller) { ProjectBrowser.BreadCrumbListMenu.m_Caller = caller; string[] subFolders = AssetDatabase.GetSubFolders(folder); GenericMenu genericMenu = new GenericMenu(); if (subFolders.Length >= 0) { currentSubFolder = Path.GetFileName(currentSubFolder); string[] array = subFolders; for (int i = 0; i < array.Length; i++) { string text = array[i]; string fileName = Path.GetFileName(text); genericMenu.AddItem(new GUIContent(fileName), fileName == currentSubFolder, new GenericMenu.MenuFunction(new ProjectBrowser.BreadCrumbListMenu(text).SelectSubFolder)); genericMenu.ShowAsContext(); } } else { genericMenu.AddDisabledItem(new GUIContent("No sub folders...")); } genericMenu.DropDown(activatorRect); }
private void SetAsLastInteractedProjectBrowser() { ProjectBrowser.s_LastInteractedProjectBrowser = this; }
private void SetViewMode(ProjectBrowser.ViewMode newViewMode) { if (this.m_ViewMode == newViewMode) return; this.EndRenaming(); this.InitViewMode(this.m_ViewMode != ProjectBrowser.ViewMode.OneColumn ? ProjectBrowser.ViewMode.OneColumn : ProjectBrowser.ViewMode.TwoColumns); if (Selection.activeInstanceID != 0) this.FrameObjectPrivate(Selection.activeInstanceID, !this.m_IsLocked, false); this.RepaintImmediately(); }
private void InitViewMode(ProjectBrowser.ViewMode viewMode) { this.m_ViewMode = viewMode; this.m_FolderTree = (TreeView) null; this.m_AssetTree = (TreeView) null; this.useTreeViewSelectionInsteadOfMainSelection = false; if (this.m_ViewMode == ProjectBrowser.ViewMode.OneColumn) { this.m_AssetTree = new TreeView((EditorWindow) this, this.m_AssetTreeState); this.m_AssetTree.deselectOnUnhandledMouseDown = true; this.m_AssetTree.selectionChangedCallback += new System.Action<int[]>(this.AssetTreeSelectionCallback); this.m_AssetTree.keyboardInputCallback += new System.Action(this.AssetTreeKeyboardInputCallback); this.m_AssetTree.contextClickItemCallback += new System.Action<int>(this.AssetTreeViewContextClick); this.m_AssetTree.contextClickOutsideItemsCallback += new System.Action(this.AssetTreeViewContextClickOutsideItems); this.m_AssetTree.itemDoubleClickedCallback += new System.Action<int>(this.AssetTreeItemDoubleClickedCallback); this.m_AssetTree.onGUIRowCallback += new System.Action<int, Rect>(this.OnGUIAssetCallback); this.m_AssetTree.dragEndedCallback += new System.Action<int[], bool>(this.AssetTreeDragEnded); this.m_AssetTree.Init(this.m_TreeViewRect, (ITreeViewDataSource) new AssetsTreeViewDataSource(this.m_AssetTree, AssetDatabase.GetInstanceIDFromGUID(AssetDatabase.AssetPathToGUID("Assets")), false, false) { foldersFirst = this.GetShouldShowFoldersFirst() }, (ITreeViewGUI) new AssetsTreeViewGUI(this.m_AssetTree), (ITreeViewDragging) new AssetsTreeViewDragging(this.m_AssetTree)); this.m_AssetTree.ReloadData(); } else if (this.m_ViewMode == ProjectBrowser.ViewMode.TwoColumns) { this.m_FolderTree = new TreeView((EditorWindow) this, this.m_FolderTreeState); this.m_FolderTree.deselectOnUnhandledMouseDown = false; this.m_FolderTree.selectionChangedCallback += new System.Action<int[]>(this.FolderTreeSelectionCallback); this.m_FolderTree.contextClickItemCallback += new System.Action<int>(this.FolderTreeViewContextClick); this.m_FolderTree.onGUIRowCallback += new System.Action<int, Rect>(this.OnGUIAssetCallback); this.m_FolderTree.dragEndedCallback += new System.Action<int[], bool>(this.FolderTreeDragEnded); this.m_FolderTree.Init(this.m_TreeViewRect, (ITreeViewDataSource) new ProjectBrowserColumnOneTreeViewDataSource(this.m_FolderTree), (ITreeViewGUI) new ProjectBrowserColumnOneTreeViewGUI(this.m_FolderTree), (ITreeViewDragging) new ProjectBrowserColumnOneTreeViewDragging(this.m_FolderTree)); this.m_FolderTree.ReloadData(); } this.minSize = new Vector2(this.m_ViewMode != ProjectBrowser.ViewMode.OneColumn ? 230f : 230f, 250f); this.maxSize = new Vector2(10000f, 10000f); }
private void SetSearchViewState(ProjectBrowser.SearchViewState state) { switch (state) { case ProjectBrowser.SearchViewState.NotSearching: Debug.LogError((object) "Invalid search mode as setter"); break; case ProjectBrowser.SearchViewState.AllAssets: this.m_SearchFilter.searchArea = SearchFilter.SearchArea.AllAssets; break; case ProjectBrowser.SearchViewState.SubFolders: this.m_SearchFilter.searchArea = SearchFilter.SearchArea.SelectedFolders; break; case ProjectBrowser.SearchViewState.AssetStore: this.m_SearchFilter.searchArea = SearchFilter.SearchArea.AssetStore; break; } this.InitSearchMenu(); this.InitListArea(); }
private void OnEnable() { this.titleContent = this.GetLocalizedTitleContent(); ProjectBrowser.s_ProjectBrowsers.Add(this); EditorApplication.projectWindowChanged += new EditorApplication.CallbackFunction(this.OnProjectChanged); EditorApplication.playmodeStateChanged += new EditorApplication.CallbackFunction(this.OnPlayModeStateChanged); EditorApplication.assetLabelsChanged += new EditorApplication.CallbackFunction(this.OnAssetLabelsChanged); EditorApplication.assetBundleNameChanged += new EditorApplication.CallbackFunction(this.OnAssetBundleNameChanged); ProjectBrowser.s_LastInteractedProjectBrowser = this; }
private void OnDestroy() { if (this.m_ListArea != null) this.m_ListArea.OnDestroy(); if (!((UnityEngine.Object) this == (UnityEngine.Object) ProjectBrowser.s_LastInteractedProjectBrowser)) return; ProjectBrowser.s_LastInteractedProjectBrowser = (ProjectBrowser) null; }
private void InitViewMode(ProjectBrowser.ViewMode viewMode) { this.m_ViewMode = viewMode; this.m_FolderTree = null; this.m_AssetTree = null; this.useTreeViewSelectionInsteadOfMainSelection = false; if (this.m_ViewMode == ProjectBrowser.ViewMode.OneColumn) { this.m_AssetTree = new TreeView(this, this.m_AssetTreeState); this.m_AssetTree.deselectOnUnhandledMouseDown = true; TreeView expr_4B = this.m_AssetTree; expr_4B.selectionChangedCallback = (Action<int[]>)Delegate.Combine(expr_4B.selectionChangedCallback, new Action<int[]>(this.AssetTreeSelectionCallback)); TreeView expr_72 = this.m_AssetTree; expr_72.keyboardInputCallback = (Action)Delegate.Combine(expr_72.keyboardInputCallback, new Action(this.AssetTreeKeyboardInputCallback)); TreeView expr_99 = this.m_AssetTree; expr_99.contextClickCallback = (Action<int>)Delegate.Combine(expr_99.contextClickCallback, new Action<int>(this.AssetTreeViewContextClick)); TreeView expr_C0 = this.m_AssetTree; expr_C0.itemDoubleClickedCallback = (Action<int>)Delegate.Combine(expr_C0.itemDoubleClickedCallback, new Action<int>(this.AssetTreeItemDoubleClickedCallback)); TreeView expr_E7 = this.m_AssetTree; expr_E7.onGUIRowCallback = (Action<int, Rect>)Delegate.Combine(expr_E7.onGUIRowCallback, new Action<int, Rect>(this.OnGUIAssetCallback)); TreeView expr_10E = this.m_AssetTree; expr_10E.dragEndedCallback = (Action<int[], bool>)Delegate.Combine(expr_10E.dragEndedCallback, new Action<int[], bool>(this.AssetTreeDragEnded)); string guid = AssetDatabase.AssetPathToGUID("Assets"); AssetsTreeViewDataSource assetsTreeViewDataSource = new AssetsTreeViewDataSource(this.m_AssetTree, AssetDatabase.GetInstanceIDFromGUID(guid), false, false); assetsTreeViewDataSource.foldersFirst = this.GetShouldShowFoldersFirst(); this.m_AssetTree.Init(this.m_TreeViewRect, assetsTreeViewDataSource, new AssetsTreeViewGUI(this.m_AssetTree), new AssetsTreeViewDragging(this.m_AssetTree)); this.m_AssetTree.ReloadData(); } else { if (this.m_ViewMode == ProjectBrowser.ViewMode.TwoColumns) { this.m_FolderTree = new TreeView(this, this.m_FolderTreeState); this.m_FolderTree.deselectOnUnhandledMouseDown = false; TreeView expr_1C2 = this.m_FolderTree; expr_1C2.selectionChangedCallback = (Action<int[]>)Delegate.Combine(expr_1C2.selectionChangedCallback, new Action<int[]>(this.FolderTreeSelectionCallback)); TreeView expr_1E9 = this.m_FolderTree; expr_1E9.contextClickCallback = (Action<int>)Delegate.Combine(expr_1E9.contextClickCallback, new Action<int>(this.FolderTreeViewContextClick)); TreeView expr_210 = this.m_FolderTree; expr_210.onGUIRowCallback = (Action<int, Rect>)Delegate.Combine(expr_210.onGUIRowCallback, new Action<int, Rect>(this.OnGUIAssetCallback)); TreeView expr_237 = this.m_FolderTree; expr_237.dragEndedCallback = (Action<int[], bool>)Delegate.Combine(expr_237.dragEndedCallback, new Action<int[], bool>(this.FolderTreeDragEnded)); this.m_FolderTree.Init(this.m_TreeViewRect, new ProjectBrowserColumnOneTreeViewDataSource(this.m_FolderTree), new ProjectBrowserColumnOneTreeViewGUI(this.m_FolderTree), new ProjectBrowserColumnOneTreeViewDragging(this.m_FolderTree)); this.m_FolderTree.ReloadData(); } } float x = (this.m_ViewMode != ProjectBrowser.ViewMode.OneColumn) ? 230f : 230f; base.minSize = new Vector2(x, 250f); base.maxSize = new Vector2(10000f, 10000f); }
private void OnEnable() { base.title = "Project"; ProjectBrowser.s_ProjectBrowsers.Add(this); EditorApplication.projectWindowChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.projectWindowChanged, new EditorApplication.CallbackFunction(this.OnProjectChanged)); EditorApplication.playmodeStateChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.playmodeStateChanged, new EditorApplication.CallbackFunction(this.OnPlayModeStateChanged)); EditorApplication.assetLabelsChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.assetLabelsChanged, new EditorApplication.CallbackFunction(this.OnAssetLabelsChanged)); ProjectBrowser.s_LastInteractedProjectBrowser = this; }
private void OnDestroy() { if (this.m_ListArea != null) { this.m_ListArea.OnDestroy(); } if (this == ProjectBrowser.s_LastInteractedProjectBrowser) { ProjectBrowser.s_LastInteractedProjectBrowser = null; } }