public void Init(Rect rect, BackendData backendData) { if (this.m_TreeView == null) { ITreeViewDataSource source; this.m_BackendData = backendData; TreeViewState treeViewState = new TreeViewState { columnWidths = new float[] { 250f, 90f, 93f, 98f, 74f, 78f } }; this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState); ITreeViewGUI gui = new TestGUI(this.m_TreeView); ITreeViewDragging dragging = new TestDragging(this.m_TreeView, this.m_BackendData); if (this.m_Lazy) { source = new LazyTestDataSource(this.m_TreeView, this.m_BackendData); } else { source = new TestDataSource(this.m_TreeView, this.m_BackendData); } this.m_TreeView.Init(rect, source, gui, dragging); this.m_ColumnHeader = new TreeViewColumnHeader(); this.m_ColumnHeader.columnWidths = treeViewState.columnWidths; this.m_ColumnHeader.minColumnWidth = 30f; this.m_ColumnHeader.columnRenderer = (Action<int, Rect>) Delegate.Combine(this.m_ColumnHeader.columnRenderer, new Action<int, Rect>(this.OnColumnRenderer)); } }
public FrameDebuggerTreeView(FrameDebuggerEvent[] frameEvents, TreeViewState treeViewState, FrameDebuggerWindow window, Rect startRect) { this.m_FrameDebugger = window; this.m_TreeView = new TreeView(window, treeViewState); this.m_DataSource = new FDTreeViewDataSource(this.m_TreeView, frameEvents); FDTreeViewGUI gui = new FDTreeViewGUI(this.m_TreeView); this.m_TreeView.Init(startRect, this.m_DataSource, gui, null); this.m_TreeView.ReloadData(); this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.SelectionChanged)); }
public FrameDebuggerTreeView(FrameDebuggerEvent[] frameEvents, TreeViewState treeViewState, FrameDebuggerWindow window, Rect startRect) { this.m_FrameDebugger = window; this.m_TreeView = new TreeView((EditorWindow) window, treeViewState); this.m_DataSource = new FrameDebuggerTreeView.FDTreeViewDataSource(this.m_TreeView, frameEvents); FrameDebuggerTreeView.FDTreeViewGUI fdTreeViewGui = new FrameDebuggerTreeView.FDTreeViewGUI(this.m_TreeView); this.m_TreeView.Init(startRect, (ITreeViewDataSource) this.m_DataSource, (ITreeViewGUI) fdTreeViewGui, (ITreeViewDragging) null); this.m_TreeView.ReloadData(); this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.SelectionChanged); }
public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback) { this.m_TreeView = new TreeView((EditorWindow) mixerWindow, treeState); this.m_TreeView.deselectOnUnhandledMouseDown = false; this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.OnTreeSelectionChanged); this.m_TreeView.contextClickItemCallback += new System.Action<int>(this.OnTreeViewContextClick); AudioMixersTreeViewGUI mixersTreeViewGui = new AudioMixersTreeViewGUI(this.m_TreeView); AudioMixersDataSource mixersDataSource = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback); AudioMixerTreeViewDragging treeViewDragging = new AudioMixerTreeViewDragging(this.m_TreeView, new System.Action<List<AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback)); this.m_TreeView.Init(mixerWindow.position, (ITreeViewDataSource) mixersDataSource, (ITreeViewGUI) mixersTreeViewGui, (ITreeViewDragging) treeViewDragging); this.m_TreeView.ReloadData(); }
public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback) { this.m_TreeView = new TreeView(mixerWindow, treeState); this.m_TreeView.deselectOnUnhandledMouseDown = false; this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged)); this.m_TreeView.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick)); AudioMixersTreeViewGUI gui = new AudioMixersTreeViewGUI(this.m_TreeView); AudioMixersDataSource data = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback); AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action<List<AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback)); this.m_TreeView.Init(mixerWindow.position, data, gui, dragging); this.m_TreeView.ReloadData(); }
public void InitIfNeeded(EditorWindow owner, Rect rect) { if (this.m_TreeViewState != null) return; this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView(owner, this.m_TreeViewState); this.m_TreeView.deselectOnUnhandledMouseDown = true; this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state); TreeViewGUI treeViewGui = (TreeViewGUI) new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner); this.m_TreeView.Init(rect, (ITreeViewDataSource) this.m_TreeViewDataSource, (ITreeViewGUI) treeViewGui, (ITreeViewDragging) null); this.m_TreeViewDataSource.UpdateData(); }
public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect) { this.m_PackageExport = packageExport; this.m_TreeView = new TreeView((EditorWindow) this.m_PackageExport, treeViewState); PackageExportTreeView.PackageExportTreeViewDataSource treeViewDataSource = new PackageExportTreeView.PackageExportTreeViewDataSource(this.m_TreeView, this); PackageExportTreeView.PackageExportTreeViewGUI exportTreeViewGui = new PackageExportTreeView.PackageExportTreeViewGUI(this.m_TreeView, this); this.m_TreeView.Init(startRect, (ITreeViewDataSource) treeViewDataSource, (ITreeViewGUI) exportTreeViewGui, (ITreeViewDragging) null); this.m_TreeView.ReloadData(); this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.SelectionChanged); exportTreeViewGui.itemWasToggled += new System.Action<PackageExportTreeView.PackageExportTreeViewItem>(this.ItemWasToggled); this.ComputeEnabledStateForFolders(); }
public void Init(SketchUpNodeInfo[] nodes, SketchUpImporterModelEditor suModelEditor) { this.titleContent = SketchUpImportDlg.Styles.styles.windowTitle; this.minSize = this.m_WindowMinSize; this.position = new Rect(this.position.x, this.position.y, this.minSize.x, this.minSize.y); this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView((EditorWindow) this, this.m_TreeViewState); this.m_ImportGUI = new SketchUpTreeViewGUI(this.m_TreeView); this.m_DataSource = new SketchUpDataSource(this.m_TreeView, nodes); this.m_TreeView.Init(this.position, (ITreeViewDataSource) this.m_DataSource, (ITreeViewGUI) this.m_ImportGUI, (ITreeViewDragging) null); this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.OnTreeSelectionChanged); this.m_ModelEditor = new WeakReference((object) suModelEditor); this.isModal = false; }
public void InitIfNeeded(EditorWindow owner, Rect rect) { if (this.m_TreeViewState == null) { this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView(owner, this.m_TreeViewState); this.m_TreeView.deselectOnUnhandledMouseDown = true; this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state); TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner); this.m_TreeView.Init(rect, this.m_TreeViewDataSource, gui, new GameObjectsTreeViewDragging(this.m_TreeView)); this.m_TreeViewDataSource.UpdateData(); return; } }
public AudioMixerGroupTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState) { this.m_AudioGroupTreeState = treeState; this.m_AudioGroupTree = new TreeView(mixerWindow, this.m_AudioGroupTreeState); this.m_AudioGroupTree.deselectOnUnhandledMouseDown = false; this.m_AudioGroupTree.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_AudioGroupTree.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged)); this.m_AudioGroupTree.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_AudioGroupTree.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick)); this.m_AudioGroupTree.expandedStateChanged = (System.Action) Delegate.Combine(this.m_AudioGroupTree.expandedStateChanged, new System.Action(this.SaveExpandedState)); this.m_TreeViewGUI = new AudioGroupTreeViewGUI(this.m_AudioGroupTree); this.m_TreeViewGUI.NodeWasToggled = (Action<AudioMixerTreeViewNode, bool>) Delegate.Combine(this.m_TreeViewGUI.NodeWasToggled, new Action<AudioMixerTreeViewNode, bool>(this.OnNodeToggled)); this.m_AudioGroupTreeDataSource = new AudioGroupDataSource(this.m_AudioGroupTree, this.m_Controller); this.m_AudioGroupTree.Init(mixerWindow.position, this.m_AudioGroupTreeDataSource, this.m_TreeViewGUI, new AudioGroupTreeViewDragging(this.m_AudioGroupTree, this)); this.m_AudioGroupTree.ReloadData(); }
public void Init(SketchUpNodeInfo[] nodes, SketchUpImporterModelEditor suModelEditor) { base.titleContent = Styles.styles.windowTitle; base.minSize = this.m_WindowMinSize; base.position = new Rect(base.position.x, base.position.y, base.minSize.x, base.minSize.y); this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView(this, this.m_TreeViewState); this.m_ImportGUI = new SketchUpTreeViewGUI(this.m_TreeView); this.m_DataSource = new SketchUpDataSource(this.m_TreeView, nodes); this.m_TreeView.Init(base.position, this.m_DataSource, this.m_ImportGUI, null); this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged)); this.m_ModelEditor = new WeakReference(suModelEditor); this.isModal = false; }
private void Init() { if (this.m_Initialized) { return; } if (this.m_LayoutStripsOnTop == null) { this.m_LayoutStripsOnTop = new AudioMixerWindow.Layout(); } if (this.m_LayoutStripsOnTop.m_VerticalSplitter == null || this.m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2) { this.m_LayoutStripsOnTop.m_VerticalSplitter = new SplitterState(new int[] { 65, 35 }, new int[] { 85, 105 }, null); } if (this.m_LayoutStripsOnTop.m_HorizontalSplitter == null || this.m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4) { this.m_LayoutStripsOnTop.m_HorizontalSplitter = new SplitterState(new int[] { 60, 60, 60, 60 }, new int[] { 85, 85, 85, 85 }, null); } if (this.m_LayoutStripsOnRight == null) { this.m_LayoutStripsOnRight = new AudioMixerWindow.Layout(); } if (this.m_LayoutStripsOnRight.m_HorizontalSplitter == null || this.m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2) { this.m_LayoutStripsOnRight.m_HorizontalSplitter = new SplitterState(new int[] { 30, 70 }, new int[] { 160, 160 }, null); } if (this.m_LayoutStripsOnRight.m_VerticalSplitter == null || this.m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4) { this.m_LayoutStripsOnRight.m_VerticalSplitter = new SplitterState(new int[] { 60, 60, 60, 60 }, new int[] { 100, 85, 85, 85 }, null); } if (this.m_AudioGroupTreeState == null) { this.m_AudioGroupTreeState = new TreeViewState(); } this.m_GroupTree = new AudioMixerGroupTreeView(this, this.m_AudioGroupTreeState); if (this.m_MixersTreeState == null) { this.m_MixersTreeState = new TreeViewState(); } this.m_MixersTree = new AudioMixersTreeView(this, this.m_MixersTreeState, new Func<List<AudioMixerController>>(this.GetAllControllers)); if (this.m_ViewsState == null) { this.m_ViewsState = new ReorderableListWithRenameAndScrollView.State(); } this.m_GroupViews = new AudioMixerGroupViewList(this.m_ViewsState); if (this.m_SnapshotState == null) { this.m_SnapshotState = new ReorderableListWithRenameAndScrollView.State(); } this.m_SnapshotListView = new AudioMixerSnapshotListView(this.m_SnapshotState); if (this.m_ChannelStripViewState == null) { this.m_ChannelStripViewState = new AudioMixerChannelStripView.State(); } this.m_ChannelStripView = new AudioMixerChannelStripView(this.m_ChannelStripViewState); this.OnMixerControllerChanged(); this.m_Initialized = true; }
private void Init(string packagePath, AssetsItem[] items, string packageIconPath) { this.DestroyCreatedIcons(); this.m_TreeViewState = null; this.m_Tree = null; this.m_EnabledFolders = null; this.m_Assets = items; this.m_PackageName = Path.GetFileNameWithoutExtension(packagePath); this.m_PackageIconPath = packageIconPath; base.Repaint(); }
public void OnGUI() { if (PackageImport.ms_Constants == null) { PackageImport.ms_Constants = new PackageImport.Constants(); } if (this.m_Assets == null) { return; } if (this.m_TreeViewState == null) { this.m_TreeViewState = new TreeViewState(); } if (this.m_Tree == null) { this.m_Tree = new PackageImportTreeView(this.m_Assets, this.m_EnabledFolders, this.m_TreeViewState, this, default(Rect)); } if (this.m_Assets.Length > 0) { this.TopArea(); this.m_Tree.OnGUI(GUILayoutUtility.GetRect(1f, 9999f, 1f, 99999f)); this.BottomArea(); } else { GUILayout.Label("Nothing to import!", EditorStyles.boldLabel, new GUILayoutOption[0]); GUILayout.Label("All assets from this package are already in your project.", "WordWrappedLabel", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); if (GUILayout.Button("OK", new GUILayoutOption[0])) { base.Close(); GUIUtility.ExitGUI(); } GUILayout.EndHorizontal(); } }
public void Init(Rect rect, TreeViewTest.BackendData backendData) { if (this.m_TreeView != null) { return; } this.m_BackendData = backendData; TreeViewState treeViewState = new TreeViewState(); treeViewState.columnWidths = new float[] { 250f, 90f, 93f, 98f, 74f, 78f }; this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState); ITreeViewGUI gui = new TreeViewTest.TestGUI(this.m_TreeView); ITreeViewDragging dragging = new TreeViewTest.TestDragging(this.m_TreeView, this.m_BackendData); ITreeViewDataSource data; if (this.m_Lazy) { data = new TreeViewTest.LazyTestDataSource(this.m_TreeView, this.m_BackendData); } else { data = new TreeViewTest.TestDataSource(this.m_TreeView, this.m_BackendData); } this.m_TreeView.Init(rect, data, gui, dragging); this.m_ColumnHeader = new TreeViewTest.TreeViewColumnHeader(); this.m_ColumnHeader.columnWidths = treeViewState.columnWidths; this.m_ColumnHeader.minColumnWidth = 30f; TreeViewTest.TreeViewColumnHeader expr_D5 = this.m_ColumnHeader; expr_D5.columnRenderer = (Action<int, Rect>)Delegate.Combine(expr_D5.columnRenderer, new Action<int, Rect>(this.OnColumnRenderer)); }
private void Init(string packagePath, ImportPackageItem[] items, string packageIconPath, bool allowReInstall) { this.DestroyCreatedIcons(); this.m_ShowReInstall = allowReInstall; this.m_ReInstallPackage = true; this.m_TreeViewState = (TreeViewState) null; this.m_Tree = (PackageImportTreeView) null; this.m_ImportPackageItems = items; this.m_PackageName = Path.GetFileNameWithoutExtension(packagePath); this.m_PackageIconPath = packageIconPath; this.Repaint(); }
internal void OnGUI() { if (!FrameDebuggerWindow.ShowFrameDebuggerWindowValidate()) { EditorGUILayout.HelpBox("Frame Debugger requires a Pro license", MessageType.Warning, true); return; } FrameDebuggerEvent[] frameEvents = FrameDebuggerUtility.GetFrameEvents(); if (this.m_TreeViewState == null) { this.m_TreeViewState = new TreeViewState(); } if (this.m_Tree == null) { this.m_Tree = new FrameDebuggerTreeView(frameEvents, this.m_TreeViewState, this, default(Rect)); this.m_FrameEventsHash = FrameDebuggerUtility.eventsHash; this.m_Tree.m_DataSource.SetExpandedWithChildren(this.m_Tree.m_DataSource.root, true); } if (FrameDebuggerUtility.eventsHash != this.m_FrameEventsHash) { this.m_Tree.m_DataSource.SetEvents(frameEvents); this.m_FrameEventsHash = FrameDebuggerUtility.eventsHash; } int limit = FrameDebuggerUtility.limit; bool flag = this.DrawToolbar(frameEvents); if (!FrameDebuggerUtility.enabled) { GUI.enabled = true; if (!FrameDebuggerWindow.GraphicsSupportsFrameDebugger()) { EditorGUILayout.HelpBox("Frame Debugger requires multi-threaded renderer. Usually Unity uses that; if it does not try starting with -force-gfx-mt command line argument.", MessageType.Warning, true); } EditorGUILayout.HelpBox("Frame Debugger lets you step through draw calls and see how exactly frame is rendered. Click Enable!", MessageType.Info, true); } else { float fixedHeight = EditorStyles.toolbar.fixedHeight; Rect dragRect = new Rect(this.m_ListWidth, fixedHeight, 5f, base.position.height - fixedHeight); dragRect = EditorGUIUtility.HandleHorizontalSplitter(dragRect, base.position.width, 200f, 200f); this.m_ListWidth = dragRect.x; Rect rect = new Rect(0f, fixedHeight, this.m_ListWidth, base.position.height - fixedHeight); Rect rect2 = new Rect(this.m_ListWidth + 4f, fixedHeight + 4f, base.position.width - this.m_ListWidth - 8f, base.position.height - fixedHeight - 8f); this.DrawEventsTree(rect); EditorGUIUtility.DrawHorizontalSplitter(dragRect); this.DrawCurrentEvent(rect2, frameEvents); } if (flag || limit != FrameDebuggerUtility.limit) { this.RepaintOnLimitChange(); } if (this.m_RepaintFrames > 0) { this.m_Tree.SelectFrameEventIndex(FrameDebuggerUtility.limit); this.RepaintAllNeededThings(); this.m_RepaintFrames--; } }
private void BuildAssetList() { this.m_Assets = GetAssetItemsForExport(Selection.assetGUIDsDeepSelection, this.m_IncludeDependencies).ToArray<AssetsItem>(); this.m_Tree = null; this.m_TreeViewState = null; }
public PackageImportTreeView(AssetsItem[] items, List<string> enabledFolders, TreeViewState treeViewState, PackageImport packageImportWindow, Rect startRect) { this.m_TreeView = new TreeView(packageImportWindow, treeViewState); PackageImportTreeView.PackageImportTreeViewDataSource data = new PackageImportTreeView.PackageImportTreeViewDataSource(this.m_TreeView, items, enabledFolders); PackageImportTreeView.PackageImportTreeViewGUI packageImportTreeViewGUI = new PackageImportTreeView.PackageImportTreeViewGUI(this.m_TreeView); this.m_TreeView.Init(startRect, data, packageImportTreeViewGUI, null); this.m_TreeView.ReloadData(); TreeView expr_5A = this.m_TreeView; expr_5A.selectionChangedCallback = (Action<int[]>)Delegate.Combine(expr_5A.selectionChangedCallback, new Action<int[]>(this.SelectionChanged)); PackageImportTreeView.PackageImportTreeViewGUI expr_7C = packageImportTreeViewGUI; expr_7C.itemWasToggled = (Action<PackageImportTreeView.PackageImportTreeViewItem>)Delegate.Combine(expr_7C.itemWasToggled, new Action<PackageImportTreeView.PackageImportTreeViewItem>(this.ItemWasToggled)); this.ComputeEnabledStateForFolders(); }
void Init() { if (m_Initialized) { return; } if (m_LayoutStripsOnTop == null) { m_LayoutStripsOnTop = new Layout(); } if (m_LayoutStripsOnTop.m_VerticalSplitter == null || m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2) { m_LayoutStripsOnTop.m_VerticalSplitter = new SplitterState(new int[] { 65, 35 }, new int[] { 85, 105 }, null); } if (m_LayoutStripsOnTop.m_HorizontalSplitter == null || m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4) { m_LayoutStripsOnTop.m_HorizontalSplitter = new SplitterState(new int[] { 60, 60, 60, 60 }, new int[] { 85, 85, 85, 85 }, null); } if (m_LayoutStripsOnRight == null) { m_LayoutStripsOnRight = new Layout(); } if (m_LayoutStripsOnRight.m_HorizontalSplitter == null || m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2) { m_LayoutStripsOnRight.m_HorizontalSplitter = new SplitterState(new int[] { 30, 70 }, new int[] { 160, 160 }, null); } if (m_LayoutStripsOnRight.m_VerticalSplitter == null || m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4) { m_LayoutStripsOnRight.m_VerticalSplitter = new SplitterState(new int[] { 60, 60, 60, 60 }, new int[] { 100, 85, 85, 85 }, null); } if (m_AudioGroupTreeState == null) { m_AudioGroupTreeState = new TreeViewState(); } m_GroupTree = new AudioMixerGroupTreeView(this, m_AudioGroupTreeState); if (m_MixersTreeState == null) { m_MixersTreeState = new TreeViewStateWithAssetUtility(); } m_MixersTree = new AudioMixersTreeView(this, m_MixersTreeState, GetAllControllers); if (m_ViewsState == null) { m_ViewsState = new ReorderableListWithRenameAndScrollView.State(); } m_GroupViews = new AudioMixerGroupViewList(m_ViewsState); if (m_SnapshotState == null) { m_SnapshotState = new ReorderableListWithRenameAndScrollView.State(); } m_SnapshotListView = new AudioMixerSnapshotListView(m_SnapshotState); if (m_ChannelStripViewState == null) { m_ChannelStripViewState = new AudioMixerChannelStripView.State(); } m_ChannelStripView = new AudioMixerChannelStripView(m_ChannelStripViewState); OnMixerControllerChanged(); m_Initialized = true; }
private void BuildAssetList() { this.m_ExportPackageItems = PackageExport.GetAssetItemsForExport((ICollection<string>) Selection.assetGUIDsDeepSelection, this.m_IncludeDependencies).ToArray<ExportPackageItem>(); this.m_Tree = (PackageExportTreeView) null; this.m_TreeViewState = (TreeViewState) null; }
private void Init() { if (this.m_TreeViewState == null) this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView((EditorWindow) this, this.m_TreeViewState); this.m_TreeView.itemDoubleClickedCallback += new System.Action<int>(this.TreeViewItemDoubleClicked); this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.TreeViewSelectionChanged); this.m_TreeView.onGUIRowCallback += new System.Action<int, Rect>(this.OnGUIAssetCallback); this.m_TreeView.dragEndedCallback += new System.Action<int[], bool>(this.OnDragEndedCallback); this.m_TreeView.contextClickItemCallback += new System.Action<int>(this.ItemContextClick); this.m_TreeView.contextClickOutsideItemsCallback += new System.Action(this.ContextClickOutsideItems); this.m_TreeView.deselectOnUnhandledMouseDown = true; GameObjectTreeViewDataSource treeViewDataSource = new GameObjectTreeViewDataSource(this.m_TreeView, this.m_CurrenRootInstanceID, false, false); GameObjectsTreeViewDragging treeViewDragging = new GameObjectsTreeViewDragging(this.m_TreeView); GameObjectTreeViewGUI objectTreeViewGui = new GameObjectTreeViewGUI(this.m_TreeView, false); this.m_TreeView.Init(this.treeViewRect, (ITreeViewDataSource) treeViewDataSource, (ITreeViewGUI) objectTreeViewGui, (ITreeViewDragging) treeViewDragging); treeViewDataSource.searchMode = (int) this.m_SearchMode; treeViewDataSource.searchString = this.m_SearchFilter; this.m_AllowAlphaNumericalSort = EditorPrefs.GetBool("AllowAlphaNumericHierarchy", false) || InternalEditorUtility.inBatchMode; this.SetUpSortMethodLists(); this.m_TreeView.ReloadData(); }
public TreeView(EditorWindow editorWindow, TreeViewState treeViewState) { this.m_EditorWindow = editorWindow; this.state = treeViewState; }
public PrefabOverridesTreeView(GameObject selectedGameObject, TreeViewState state, PrefabOverridesWindow window) : base(state) { m_SelectedGameObject = selectedGameObject; m_Window = window; rowHeight = 18f; }
private void InitTreeView(Rect rect) { this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView(base.editorWindow, this.m_TreeViewState); AudioMixerGroupSelector.GroupTreeViewGUI groupTreeViewGUI = new AudioMixerGroupSelector.GroupTreeViewGUI(this.m_TreeView); AudioMixerGroupSelector.TreeViewDataSourceForMixers treeViewDataSourceForMixers = new AudioMixerGroupSelector.TreeViewDataSourceForMixers(this.m_TreeView, this.m_IgnoreThisController); AudioMixerGroupSelector.TreeViewDataSourceForMixers expr_41 = treeViewDataSourceForMixers; expr_41.onVisibleRowsChanged = (Action)Delegate.Combine(expr_41.onVisibleRowsChanged, new Action(groupTreeViewGUI.CalculateRowRects)); AudioMixerGroupSelector.TreeViewDataSourceForMixers expr_63 = treeViewDataSourceForMixers; expr_63.onVisibleRowsChanged = (Action)Delegate.Combine(expr_63.onVisibleRowsChanged, new Action(this.ResizeWindow)); this.m_TreeView.deselectOnUnhandledMouseDown = true; this.m_TreeView.Init(rect, treeViewDataSourceForMixers, groupTreeViewGUI, null); this.m_TreeView.ReloadData(); this.m_TreeView.selectionChangedCallback = new Action<int[]>(this.OnItemSelectionChanged); this.m_TreeView.itemDoubleClickedCallback = new Action<int>(this.OnItemDoubleClicked); this.m_TreeView.SetSelection(new int[] { (!(this.m_OriginalSelection != null)) ? 0 : this.m_OriginalSelection.GetInstanceID() }, true); }
internal void OnGUI() { FrameDebuggerEvent[] frameEvents = FrameDebuggerUtility.GetFrameEvents(); if (this.m_TreeViewState == null) this.m_TreeViewState = new TreeViewState(); if (this.m_Tree == null) { this.m_Tree = new FrameDebuggerTreeView(frameEvents, this.m_TreeViewState, this, new Rect()); this.m_FrameEventsHash = FrameDebuggerUtility.eventsHash; this.m_Tree.m_DataSource.SetExpandedWithChildren(this.m_Tree.m_DataSource.root, true); } if (FrameDebuggerUtility.eventsHash != this.m_FrameEventsHash) { this.m_Tree.m_DataSource.SetEvents(frameEvents); this.m_FrameEventsHash = FrameDebuggerUtility.eventsHash; } int limit = FrameDebuggerUtility.limit; bool flag = this.DrawToolbar(frameEvents); if (!FrameDebuggerUtility.IsLocalEnabled() && !FrameDebuggerUtility.IsRemoteEnabled() && this.m_AttachProfilerUI.IsEditor()) { GUI.enabled = true; if (!FrameDebuggerUtility.locallySupported) EditorGUILayout.HelpBox("Frame Debugger requires multi-threaded renderer. Usually Unity uses that; if it does not, try starting with -force-gfx-mt command line argument.", MessageType.Warning, true); EditorGUILayout.HelpBox("Frame Debugger lets you step through draw calls and see how exactly frame is rendered. Click Enable!", MessageType.Info, true); } else { float fixedHeight = EditorStyles.toolbar.fixedHeight; Rect dragRect = EditorGUIUtility.HandleHorizontalSplitter(new Rect(this.m_ListWidth, fixedHeight, 5f, this.position.height - fixedHeight), this.position.width, 200f, 200f); this.m_ListWidth = dragRect.x; Rect rect1 = new Rect(0.0f, fixedHeight, this.m_ListWidth, this.position.height - fixedHeight); Rect rect2 = new Rect(this.m_ListWidth + 4f, fixedHeight + 4f, (float) ((double) this.position.width - (double) this.m_ListWidth - 8.0), (float) ((double) this.position.height - (double) fixedHeight - 8.0)); this.DrawEventsTree(rect1); EditorGUIUtility.DrawHorizontalSplitter(dragRect); this.DrawCurrentEvent(rect2, frameEvents); } if (flag || limit != FrameDebuggerUtility.limit) this.RepaintOnLimitChange(); if (this.m_RepaintFrames <= 0) return; this.m_Tree.SelectFrameEventIndex(FrameDebuggerUtility.limit); this.RepaintAllNeededThings(); --this.m_RepaintFrames; }
public void Init() { if (this.Initialized()) { return; } this.m_FocusSearchField = false; bool flag = this.m_SearchFilter == null; if (flag) { this.m_DirectoriesAreaWidth = Mathf.Min(base.position.width / 2f, 200f); } if (this.m_SearchFilter == null) { this.m_SearchFilter = new SearchFilter(); } this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString(); this.CalculateRects(); this.RefreshSelectedPath(); this.SetupDroplists(); if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true; this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, false); this.m_ListArea.allowDeselection = true; this.m_ListArea.allowDragging = true; this.m_ListArea.allowFocusRendering = true; this.m_ListArea.allowMultiSelect = true; this.m_ListArea.allowRenaming = true; this.m_ListArea.allowBuiltinResources = false; this.m_ListArea.allowUserRenderingHook = true; this.m_ListArea.allowFindNextShortcut = true; this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst(); ObjectListArea expr_131 = this.m_ListArea; expr_131.repaintCallback = (Action)Delegate.Combine(expr_131.repaintCallback, new Action(base.Repaint)); ObjectListArea expr_158 = this.m_ListArea; expr_158.itemSelectedCallback = (Action<bool>)Delegate.Combine(expr_158.itemSelectedCallback, new Action<bool>(this.ListAreaItemSelectedCallback)); ObjectListArea expr_17F = this.m_ListArea; expr_17F.keyboardCallback = (Action)Delegate.Combine(expr_17F.keyboardCallback, new Action(this.ListAreaKeyboardCallback)); ObjectListArea expr_1A6 = this.m_ListArea; expr_1A6.gotKeyboardFocus = (Action)Delegate.Combine(expr_1A6.gotKeyboardFocus, new Action(this.ListGotKeyboardFocus)); ObjectListArea expr_1CD = this.m_ListArea; expr_1CD.drawLocalAssetHeader = (Func<Rect, float>)Delegate.Combine(expr_1CD.drawLocalAssetHeader, new Func<Rect, float>(this.DrawLocalAssetHeader)); ObjectListArea expr_1F4 = this.m_ListArea; expr_1F4.assetStoreSearchEnded = (Action)Delegate.Combine(expr_1F4.assetStoreSearchEnded, new Action(this.AssetStoreSearchEndedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize; this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize); this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float)this.m_ListArea.maxGridSize); this.InitListArea(); this.SyncFilterGUI(); if (this.m_FolderTreeState == null) { this.m_FolderTreeState = new TreeViewState(); } this.m_FolderTreeState.renameOverlay.isRenamingFilename = true; if (this.m_AssetTreeState == null) { this.m_AssetTreeState = new TreeViewState(); } this.m_AssetTreeState.renameOverlay.isRenamingFilename = true; this.InitViewMode(this.m_ViewMode); this.m_SearchAreaMenu = new ExposablePopupMenu(); this.RefreshSearchText(); this.DefaultSetup(); }
public void Init() { if (this.Initialized()) return; this.m_FocusSearchField = false; if (this.m_SearchFilter == null) this.m_DirectoriesAreaWidth = Mathf.Min(this.position.width / 2f, 200f); if (this.m_SearchFilter == null) this.m_SearchFilter = new SearchFilter(); this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString(); this.CalculateRects(); this.RefreshSelectedPath(); this.SetupDroplists(); if (this.m_ListAreaState == null) this.m_ListAreaState = new ObjectListAreaState(); this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true; this.m_ListArea = new ObjectListArea(this.m_ListAreaState, (EditorWindow) this, false); this.m_ListArea.allowDeselection = true; this.m_ListArea.allowDragging = true; this.m_ListArea.allowFocusRendering = true; this.m_ListArea.allowMultiSelect = true; this.m_ListArea.allowRenaming = true; this.m_ListArea.allowBuiltinResources = false; this.m_ListArea.allowUserRenderingHook = true; this.m_ListArea.allowFindNextShortcut = true; this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst(); this.m_ListArea.repaintCallback += new System.Action(((EditorWindow) this).Repaint); this.m_ListArea.itemSelectedCallback += new System.Action<bool>(this.ListAreaItemSelectedCallback); this.m_ListArea.keyboardCallback += new System.Action(this.ListAreaKeyboardCallback); this.m_ListArea.gotKeyboardFocus += new System.Action(this.ListGotKeyboardFocus); this.m_ListArea.drawLocalAssetHeader += new Func<Rect, float>(this.DrawLocalAssetHeader); this.m_ListArea.assetStoreSearchEnded += new System.Action(this.AssetStoreSearchEndedCallback); this.m_ListArea.gridSize = this.m_StartGridSize; this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize); this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float) this.m_ListArea.maxGridSize); this.InitListArea(); this.SyncFilterGUI(); if (this.m_FolderTreeState == null) this.m_FolderTreeState = new TreeViewState(); this.m_FolderTreeState.renameOverlay.isRenamingFilename = true; if (this.m_AssetTreeState == null) this.m_AssetTreeState = new TreeViewState(); this.m_AssetTreeState.renameOverlay.isRenamingFilename = true; this.InitViewMode(this.m_ViewMode); this.m_SearchAreaMenu = new ExposablePopupMenu(); this.RefreshSearchText(); this.DefaultSetup(); }
private void InitTreeView(Rect rect) { TreeViewDataSourceForMixers mixers; this.m_TreeViewState = new TreeViewState(); this.m_TreeView = new TreeView(base.editorWindow, this.m_TreeViewState); GroupTreeViewGUI gui = new GroupTreeViewGUI(this.m_TreeView); mixers = new TreeViewDataSourceForMixers(this.m_TreeView, this.m_IgnoreThisController) { onVisibleRowsChanged = (System.Action) Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(gui.CalculateRowRects)), onVisibleRowsChanged = (System.Action) Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(this.ResizeWindow)) }; this.m_TreeView.deselectOnUnhandledMouseDown = true; this.m_TreeView.Init(rect, mixers, gui, null); this.m_TreeView.ReloadData(); this.m_TreeView.selectionChangedCallback = new Action<int[]>(this.OnItemSelectionChanged); this.m_TreeView.itemDoubleClickedCallback = new Action<int>(this.OnItemDoubleClicked); int[] selectedIDs = new int[] { (this.m_OriginalSelection == null) ? 0 : this.m_OriginalSelection.GetInstanceID() }; this.m_TreeView.SetSelection(selectedIDs, true); }
private void TreeViewArea(bool showLoadingScreen) { Rect rect = GUILayoutUtility.GetRect(1f, 9999f, 1f, 99999f); if (showLoadingScreen) { GUI.Label(rect, "Loading...", PackageExport.Styles.loadingTextStyle); } else { if (this.m_ExportPackageItems == null || this.m_ExportPackageItems.Length <= 0) return; if (this.m_TreeViewState == null) this.m_TreeViewState = new TreeViewState(); if (this.m_Tree == null) this.m_Tree = new PackageExportTreeView(this, this.m_TreeViewState, new Rect()); this.m_Tree.OnGUI(rect); } }
public void OnGUI() { if (PackageImport.ms_Constants == null) PackageImport.ms_Constants = new PackageImport.Constants(); if (this.m_TreeViewState == null) this.m_TreeViewState = new TreeViewState(); if (this.m_Tree == null) this.m_Tree = new PackageImportTreeView(this, this.m_TreeViewState, new Rect()); if (this.m_ImportPackageItems != null && this.ShowTreeGUI(this.doReInstall, this.m_ImportPackageItems)) { this.TopArea(); this.m_Tree.OnGUI(GUILayoutUtility.GetRect(1f, 9999f, 1f, 99999f)); this.BottomArea(); } else { GUILayout.Label("Nothing to import!", EditorStyles.boldLabel, new GUILayoutOption[0]); GUILayout.Label("All assets from this package are already in your project.", (GUIStyle) "WordWrappedLabel", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(PackageImport.ms_Constants.bottomBarBg, new GUILayoutOption[0]); GUILayout.Space(8f); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); this.ReInstallToggle(); if (GUILayout.Button("OK")) { this.Close(); GUIUtility.ExitGUI(); } GUILayout.Space(10f); GUILayout.EndHorizontal(); GUILayout.Space(5f); GUILayout.EndVertical(); } }
private void Init() { if (this.m_TreeView != null) { return; } if (this.m_TreeViewState == null) { this.m_TreeViewState = new TreeViewState(); } this.m_TreeView = new TreeView(this, this.m_TreeViewState); TreeView expr_3A = this.m_TreeView; expr_3A.itemDoubleClickedCallback = (Action<int>)Delegate.Combine(expr_3A.itemDoubleClickedCallback, new Action<int>(this.TreeViewItemDoubleClicked)); TreeView expr_61 = this.m_TreeView; expr_61.selectionChangedCallback = (Action<int[]>)Delegate.Combine(expr_61.selectionChangedCallback, new Action<int[]>(this.TreeViewSelectionChanged)); TreeView expr_88 = this.m_TreeView; expr_88.onGUIRowCallback = (Action<int, Rect>)Delegate.Combine(expr_88.onGUIRowCallback, new Action<int, Rect>(this.OnGUIAssetCallback)); TreeView expr_AF = this.m_TreeView; expr_AF.dragEndedCallback = (Action<int[], bool>)Delegate.Combine(expr_AF.dragEndedCallback, new Action<int[], bool>(this.OnDragEndedCallback)); this.m_TreeView.deselectOnUnhandledMouseDown = true; GameObjectTreeViewDataSource gameObjectTreeViewDataSource = new GameObjectTreeViewDataSource(this.m_TreeView, 0, false, false); GameObjectsTreeViewDragging dragging = new GameObjectsTreeViewDragging(this.m_TreeView); GameObjectTreeViewGUI gui = new GameObjectTreeViewGUI(this.m_TreeView, false); this.m_TreeView.Init(this.treeViewRect, gameObjectTreeViewDataSource, gui, dragging); gameObjectTreeViewDataSource.searchMode = (int)this.m_SearchMode; gameObjectTreeViewDataSource.searchString = this.m_SearchFilter; this.m_AllowAlphaNumericalSort = (EditorPrefs.GetBool("AllowAlphaNumericHierarchy", false) || InternalEditorUtility.inBatchMode); this.SetUpSortMethodLists(); this.m_TreeView.ReloadData(); }
public OptimizeGameObjectTreeView(TreeViewState state, MultiColumnHeader multiColumnHeader, Func <SerializedNodeInfo> rebuildRoot) : base(state, multiColumnHeader, rebuildRoot) { }