Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
		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);
		}