public static BeginHorizontalSplit ( |
||
state | ||
return | void |
void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { // Do layouting SplitterState horizontalState = m_LayoutStripsOnTop.m_HorizontalSplitter; SplitterState verticalState = m_LayoutStripsOnTop.m_VerticalSplitter; SplitterGUILayout.BeginVerticalSplit(verticalState, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); if (m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(); GUILayout.EndVertical(); } SplitterGUILayout.BeginHorizontalSplit(horizontalState, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); if (!m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(); GUILayout.EndVertical(); } SplitterGUILayout.EndHorizontalSplit(); SplitterGUILayout.EndVerticalSplit(); float channelStripYPos = m_GroupsRenderedAboveSections ? EditorGUI.kWindowToolbarHeight : EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0]; float channelStripHeight = m_GroupsRenderedAboveSections ? verticalState.realSizes[0] : verticalState.realSizes[1]; float sectionsYPos = !m_GroupsRenderedAboveSections ? EditorGUI.kWindowToolbarHeight : EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0]; float sectionsHeight = !m_GroupsRenderedAboveSections ? verticalState.realSizes[0] : verticalState.realSizes[1]; Rect channelStripViewRect = new Rect(0, channelStripYPos, position.width, channelStripHeight); Rect totalRectOfSections = new Rect(0, channelStripViewRect.yMax, position.width, position.height - channelStripViewRect.height); // Rects for sections Rect[] sectionRects = new Rect[m_SectionOrder.Length]; const float spaceFromBottom = 12f; for (int i = 0; i < sectionRects.Length; i++) { float xPos = (i > 0) ? sectionRects[i - 1].xMax : 0f; sectionRects[i] = new Rect(xPos, sectionsYPos, horizontalState.realSizes[i], sectionsHeight - spaceFromBottom); } // Spacing between lists const float halfSpaceBetween = 4f; sectionRects[0].x += 2 * halfSpaceBetween; sectionRects[0].width -= 3 * halfSpaceBetween; sectionRects[sectionRects.Length - 1].x += halfSpaceBetween; sectionRects[sectionRects.Length - 1].width -= 3 * halfSpaceBetween; for (int i = 1; i < sectionRects.Length - 1; i++) { sectionRects[i].x += halfSpaceBetween; sectionRects[i].width -= halfSpaceBetween * 2; } // Do content DoSections(totalRectOfSections, sectionRects, m_SectionOrder); m_ChannelStripView.OnGUI(channelStripViewRect, m_ShowReferencedBuses, m_ShowBusConnections, m_ShowBusConnectionsOfSelection, allGroups, effectMap, m_SortGroupsAlphabetically, m_ShowDeveloperOverlays, m_GroupTree.ScrollToItem); // Horizontal line (split) EditorGUI.DrawRect(new Rect(0, EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0] - 1, position.width, 1), new Color(0f, 0f, 0f, 0.4f)); }
private void DrawDetailedMemoryPane(SplitterState splitter) { SplitterGUILayout.BeginHorizontalSplit(splitter, new GUILayoutOption[0]); this.m_MemoryListView.OnGUI(); this.m_ReferenceListView.OnGUI(); SplitterGUILayout.EndHorizontalSplit(); }
public void OnGUI() { GUILayout.BeginVertical(new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.m_Splitter, EditorStyles.toolbar, new GUILayoutOption[0]); this.DrawHeader(); SplitterGUILayout.EndHorizontalSplit(); if (this.m_Root == null) { GUILayout.EndVertical(); } else { this.HandleKeyboard(); this.m_ScrollPosition = GUILayout.BeginScrollView(this.m_ScrollPosition, MemoryTreeList.styles.background); int num = 0; foreach (MemoryElement current in this.m_Root.children) { this.DrawItem(current, ref num, 1); num++; } GUILayoutUtility.GetRect(0f, (float)num * 16f, new GUILayoutOption[] { GUILayout.ExpandWidth(true) }); if (Event.current.type == EventType.Repaint) { this.m_VisibleHeight = GUIClip.visibleRect.height; } GUILayout.EndScrollView(); GUILayout.EndVertical(); } }
void ShowDrawInstructions() { if (inspected == null) { ClearInstructionHighlighter(); return; } SplitterGUILayout.BeginHorizontalSplit(m_InstructionListDetailSplitter); instructionModeView.DrawInstructionList(); EditorGUILayout.BeginVertical(); { if (m_StylePicker.IsPicking && m_StylePicker.ExploredDrawInstructionIndex != -1 && m_InstructionType == InstructionType.Draw) { m_InstructionModeView.ClearRowSelection(); m_InstructionModeView.SelectRow(m_StylePicker.ExploredDrawInstructionIndex); } instructionModeView.DrawSelectedInstructionDetails(position.width - m_InstructionListDetailSplitter.realSizes[0]); } EditorGUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); }
public void OnGUI() { GUILayout.BeginVertical(); SplitterGUILayout.BeginHorizontalSplit(this.m_Splitter, EditorStyles.toolbar, new GUILayoutOption[0]); this.DrawHeader(); SplitterGUILayout.EndHorizontalSplit(); if (this.m_Root == null) { GUILayout.EndVertical(); } else { this.HandleKeyboard(); this.m_ScrollPosition = GUILayout.BeginScrollView(this.m_ScrollPosition, MemoryTreeList.styles.background); int row = 0; using (List <MemoryElement> .Enumerator enumerator = this.m_Root.children.GetEnumerator()) { while (enumerator.MoveNext()) { this.DrawItem(enumerator.Current, ref row, 1); ++row; } } GUILayoutUtility.GetRect(0.0f, (float)((double)row * 16.0), new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (Event.current.type == EventType.Repaint) { this.m_VisibleHeight = GUIClip.visibleRect.height; } GUILayout.EndScrollView(); GUILayout.EndVertical(); } }
private void ShowDrawInstructions() { if (this.m_Inspected == null) { return; } this.m_ListViewState.totalRows = GUIViewDebuggerHelper.GetInstructionCount(); if (this.m_QueuedPointInspection) { this.m_ListViewState.row = this.FindInstructionUnderPoint(this.m_PointToInspect); this.m_ListViewState.selectionChanged = true; this.m_QueuedPointInspection = false; this.m_Instruction.Reset(); } SplitterGUILayout.BeginHorizontalSplit(this.m_InstructionListDetailSplitter, new GUILayoutOption[0]); this.DrawInstructionList(); EditorGUILayout.BeginVertical(new GUILayoutOption[0]); if (this.m_ListViewState.selectionChanged) { this.OnSelectedInstructionChanged(); } this.DrawSelectedInstructionDetails(); EditorGUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); }
void ShowDrawInstructions() { if (inspected == null) { ClearInstructionHighlighter(); return; } if (m_QueuedPointInspection) { instructionModeView.ClearRowSelection(); instructionModeView.SelectRow(FindInstructionUnderPoint(m_PointToInspect)); m_QueuedPointInspection = false; } SplitterGUILayout.BeginHorizontalSplit(m_InstructionListDetailSplitter); instructionModeView.DrawInstructionList(); EditorGUILayout.BeginVertical(); { instructionModeView.DrawSelectedInstructionDetails(); } EditorGUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); }
private void LayoutWithStripsOnRightSideOneScrollBar(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { SplitterState horizontalSplitter = this.m_LayoutStripsOnRight.m_HorizontalSplitter; SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); SplitterGUILayout.EndHorizontalSplit(); float num = (float)horizontalSplitter.realSizes[0]; float width = base.position.width - num; Rect rect = new Rect(0f, 17f, num, base.position.height - 17f); Rect rect2 = new Rect(num, 17f, width, rect.height); if (EditorGUIUtility.isProSkin) { EditorGUI.DrawRect(rect, (!EditorGUIUtility.isProSkin) ? new Color(0.6f, 0.6f, 0.6f, 0f) : new Color(0.19f, 0.19f, 0.19f)); } float num2 = 10f; Rect[] array = new Rect[this.m_SectionOrder.Length]; float num3 = 0f; for (int i = 0; i < this.m_SectionOrder.Length; i++) { num3 += num2; if (i > 0) { num3 += array[i - 1].height; } array[i] = new Rect(0f, num3, rect.width, this.GetHeightOfSection(this.m_SectionOrder[i])); Rect[] expr_157_cp_0 = array; int expr_157_cp_1 = i; expr_157_cp_0[expr_157_cp_1].x = expr_157_cp_0[expr_157_cp_1].x + 4f; Rect[] expr_171_cp_0 = array; int expr_171_cp_1 = i; expr_171_cp_0[expr_171_cp_1].width = expr_171_cp_0[expr_171_cp_1].width - 8f; } Rect viewRect = new Rect(0f, 0f, 1f, array.Last <Rect>().yMax); if (viewRect.height > rect.height) { for (int j = 0; j < array.Length; j++) { Rect[] expr_1E3_cp_0 = array; int expr_1E3_cp_1 = j; expr_1E3_cp_0[expr_1E3_cp_1].width = expr_1E3_cp_0[expr_1E3_cp_1].width - 14f; } } this.m_SectionsScrollPosition = GUI.BeginScrollView(rect, this.m_SectionsScrollPosition, viewRect); this.DoSections(rect, array, this.m_SectionOrder); GUI.EndScrollView(); this.m_ChannelStripView.OnGUI(rect2, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem); EditorGUI.DrawRect(new Rect(rect.xMax - 1f, 17f, 1f, base.position.height - 17f), (!EditorGUIUtility.isProSkin) ? new Color(0.6f, 0.6f, 0.6f) : new Color(0.15f, 0.15f, 0.15f)); }
private void DoTitles(SplitterState splitter) { SplitterGUILayout.BeginHorizontalSplit(splitter, new GUILayoutOption[0]); for (int i = 0; i < this.titleNames.Length; i++) { GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MaxHeight(16f) }; GUILayout.Toggle(false, this.titleNames[i], EditorStyles.toolbarButton, options); } SplitterGUILayout.EndHorizontalSplit(); }
public void OnAnimEditorGUI(EditorWindow parent, Rect position) { this.m_DopeSheet.m_Owner = parent; this.m_OwnerWindow = parent; this.m_Position = position; if (!this.m_Initialized) { this.Initialize(); } this.m_State.OnGUI(); if (this.m_State.disabled && this.controlInterface.recording) { this.m_State.StopRecording(); } this.SynchronizeLayout(); using (new EditorGUI.DisabledScope(this.m_State.disabled || this.m_State.animatorIsOptimized)) { this.OverlayEventOnGUI(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.m_HorizontalSplitter, new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); this.PlayControlsOnGUI(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); this.LinkOptionsOnGUI(); this.ClipSelectionDropDownOnGUI(); GUILayout.FlexibleSpace(); this.FrameRateInputFieldOnGUI(); this.AddKeyframeButtonOnGUI(); this.AddEventButtonOnGUI(); GUILayout.EndHorizontal(); this.HierarchyOnGUI(); GUILayout.BeginHorizontal(AnimationWindowStyles.miniToolbar, new GUILayoutOption[0]); this.TabSelectionOnGUI(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); Rect rect = GUILayoutUtility.GetRect(this.contentWidth, 18f); Rect rect2 = GUILayoutUtility.GetRect(this.contentWidth, 18f); Rect rect3 = GUILayoutUtility.GetRect(this.contentWidth, this.contentWidth, 0f, 3.40282347E+38f, new GUILayoutOption[] { GUILayout.ExpandHeight(true) }); this.MainContentOnGUI(rect3); this.TimeRulerOnGUI(rect); this.EventLineOnGUI(rect2); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); GUILayout.EndHorizontal(); this.OverlayOnGUI(rect3); this.RenderEventTooltip(); this.HandleHotKeys(); } }
public void OnAnimEditorGUI(EditorWindow parent, Rect position) { this.m_DopeSheet.m_Owner = parent; this.m_OwnerWindow = parent; this.m_Position = position; if (!this.m_Initialized) { this.Initialize(); } this.m_State.OnGUI(); this.SynchronizeLayout(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.m_HorizontalSplitter, new GUILayoutOption[0]); using (new EditorGUI.DisabledScope(this.m_State.disabled || this.m_State.animatorIsOptimized)) { GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); using (new EditorGUI.DisabledScope(!this.m_State.canRecord || Application.isPlaying)) { if (this.policy == null || this.policy.allowRecording) { this.RecordButtonOnGUI(); this.PlayButtonOnGUI(); } } this.FrameNavigationOnGUI(); this.AddKeyframeButtonOnGUI(); this.AddEventButtonOnGUI(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); this.ClipSelectionDropDownOnGUI(); this.FrameRateInputFieldOnGUI(); GUILayout.EndHorizontal(); this.HierarchyOnGUI(); GUILayout.BeginHorizontal(AnimationWindowStyles.miniToolbar, new GUILayoutOption[0]); this.TabSelectionOnGUI(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); Rect rect = GUILayoutUtility.GetRect(this.m_Position.width - this.hierarchyWidth, 18f); Rect rect2 = GUILayoutUtility.GetRect(this.m_Position.width - this.hierarchyWidth, 18f); Rect contentLayoutRect = this.GetContentLayoutRect(); this.MainContentOnGUI(contentLayoutRect); this.TimeRulerOnGUI(rect); this.EventLineOnGUI(rect2); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); GUILayout.EndHorizontal(); this.RenderEventTooltip(); } this.HandleHotKeys(); this.PostLayoutChanges(); }
private void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { SplitterState horizontalSplitter = this.m_LayoutStripsOnTop.m_HorizontalSplitter; SplitterState verticalSplitter = this.m_LayoutStripsOnTop.m_VerticalSplitter; SplitterGUILayout.BeginVerticalSplit(verticalSplitter, new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); if (this.m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(); GUILayout.EndVertical(); } SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); if (!this.m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(); GUILayout.EndVertical(); } SplitterGUILayout.EndHorizontalSplit(); SplitterGUILayout.EndVerticalSplit(); float y1 = !this.m_GroupsRenderedAboveSections ? 17f + (float)verticalSplitter.realSizes[0] : 17f; float height = !this.m_GroupsRenderedAboveSections ? (float)verticalSplitter.realSizes[1] : (float)verticalSplitter.realSizes[0]; float y2 = this.m_GroupsRenderedAboveSections ? 17f + (float)verticalSplitter.realSizes[0] : 17f; float num = this.m_GroupsRenderedAboveSections ? (float)verticalSplitter.realSizes[1] : (float)verticalSplitter.realSizes[0]; Rect rect = new Rect(0.0f, y1, this.position.width, height); Rect totalRectOfSections = new Rect(0.0f, rect.yMax, this.position.width, this.position.height - rect.height); Rect[] sectionRects = new Rect[this.m_SectionOrder.Length]; for (int index = 0; index < sectionRects.Length; ++index) { float x = index <= 0 ? 0.0f : sectionRects[index - 1].xMax; sectionRects[index] = new Rect(x, y2, (float)horizontalSplitter.realSizes[index], num - 12f); } sectionRects[0].x += 8f; sectionRects[0].width -= 12f; sectionRects[sectionRects.Length - 1].x += 4f; sectionRects[sectionRects.Length - 1].width -= 12f; for (int index = 1; index < sectionRects.Length - 1; ++index) { sectionRects[index].x += 4f; sectionRects[index].width -= 8f; } this.DoSections(totalRectOfSections, sectionRects, this.m_SectionOrder); this.m_ChannelStripView.OnGUI(rect, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem); EditorGUI.DrawRect(new Rect(0.0f, (float)(17.0 + (double)verticalSplitter.realSizes[0] - 1.0), this.position.width, 1f), new Color(0.0f, 0.0f, 0.0f, 0.4f)); }
private void DoTitles(SplitterState splitter) { SplitterGUILayout.BeginHorizontalSplit(splitter); for (int index = 0; index < this.titleNames.Length; ++index) { GUILayout.Toggle(0 != 0, this.titleNames[index], EditorStyles.toolbarButton, new GUILayoutOption[1] { GUILayout.MaxHeight(16f) }); } SplitterGUILayout.EndHorizontalSplit(); }
private void LayoutWithStripsOnRightSideOneScrollBar(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { SplitterState horizontalSplitter = this.m_LayoutStripsOnRight.m_HorizontalSplitter; SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); SplitterGUILayout.EndHorizontalSplit(); float realSize = (float)horizontalSplitter.realSizes[0]; float width = this.position.width - realSize; Rect rect1 = new Rect(0.0f, 17f, realSize, this.position.height - 17f); Rect rect2 = new Rect(realSize, 17f, width, rect1.height); if (EditorGUIUtility.isProSkin) { EditorGUI.DrawRect(rect1, !EditorGUIUtility.isProSkin ? new Color(0.6f, 0.6f, 0.6f, 0.0f) : new Color(0.19f, 0.19f, 0.19f)); } float num = 10f; Rect[] sectionRects = new Rect[this.m_SectionOrder.Length]; float y = 0.0f; for (int index = 0; index < this.m_SectionOrder.Length; ++index) { y += num; if (index > 0) { y += sectionRects[index - 1].height; } sectionRects[index] = new Rect(0.0f, y, rect1.width, this.GetHeightOfSection(this.m_SectionOrder[index])); sectionRects[index].x += 4f; sectionRects[index].width -= 8f; } Rect viewRect = new Rect(0.0f, 0.0f, 1f, ((IEnumerable <Rect>)sectionRects).Last <Rect>().yMax); if ((double)viewRect.height > (double)rect1.height) { for (int index = 0; index < sectionRects.Length; ++index) { sectionRects[index].width -= 14f; } } this.m_SectionsScrollPosition = GUI.BeginScrollView(rect1, this.m_SectionsScrollPosition, viewRect); this.DoSections(rect1, sectionRects, this.m_SectionOrder); GUI.EndScrollView(); this.m_ChannelStripView.OnGUI(rect2, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem); EditorGUI.DrawRect(new Rect(rect1.xMax - 1f, 17f, 1f, this.position.height - 17f), !EditorGUIUtility.isProSkin ? new Color(0.6f, 0.6f, 0.6f) : new Color(0.15f, 0.15f, 0.15f)); }
private void ShowDrawInstructions() { if (!(this.m_Inspected == null)) { if (this.m_QueuedPointInspection) { this.instructionModeView.Unselect(); this.instructionModeView.SelectRow(this.FindInstructionUnderPoint(this.m_PointToInspect)); this.m_QueuedPointInspection = false; } SplitterGUILayout.BeginHorizontalSplit(this.m_InstructionListDetailSplitter, new GUILayoutOption[0]); this.instructionModeView.DrawInstructionList(); EditorGUILayout.BeginVertical(new GUILayoutOption[0]); this.instructionModeView.DrawSelectedInstructionDetails(); EditorGUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); } }
public void OnBreadcrumbGUI(EditorWindow parent, Rect position) { this.m_DopeSheet.m_Owner = parent; this.m_OwnerWindow = parent; this.m_Position = position; if (!this.m_Initialized) { this.Initialize(); } this.m_State.OnGUI(); this.ClampSplitterSize(); GUILayout.BeginHorizontal(); SplitterGUILayout.BeginHorizontalSplit(this.m_HorizontalSplitter); EditorGUI.BeginDisabledGroup(this.m_State.disabled); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); this.RecordButtonOnGUI(); this.PlayButtonOnGUI(); this.FrameNavigationOnGUI(); this.AddKeyframeButtonOnGUI(); this.AddEventButtonOnGUI(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(EditorStyles.toolbarButton, new GUILayoutOption[0]); this.ClipSelectionDropDownOnGUI(); this.FrameRateInputFieldOnGUI(); GUILayout.EndHorizontal(); this.HierarchyOnGUI(); GUILayout.BeginHorizontal(AnimationWindowStyles.miniToolbar, new GUILayoutOption[0]); this.TabSelectionButtonsOnGUI(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.BeginVertical(); this.TimeRulerOnGUI(); this.EventLineOnGUI(); this.MainContentOnGUI(); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); GUILayout.EndHorizontal(); this.RenderEventTooltip(); EditorGUI.EndDisabledGroup(); this.HandleFrameNavigationHotKeys(); }
private void DrawCPUOrRenderingPane(ProfilerHierarchyGUI mainPane, ProfilerHierarchyGUI detailPane, ProfilerTimelineGUI timelinePane) { ProfilerProperty profilerProperty = this.CreateProperty(false); this.DrawCPUOrRenderingToolbar(profilerProperty); if (!ProfilerWindow.CheckFrameData(profilerProperty)) { profilerProperty.Cleanup(); return; } if (timelinePane != null && this.m_ViewType == ProfilerViewType.Timeline) { float num = (float)this.m_VertSplit.realSizes[1]; num -= EditorStyles.toolbar.CalcHeight(GUIContent.none, 10f) + 2f; timelinePane.DoGUI(this.GetActiveVisibleFrameIndex(), base.position.width, base.position.height - num, num); profilerProperty.Cleanup(); } else { SplitterGUILayout.BeginHorizontalSplit(this.m_ViewSplit, new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); bool expandAll = false; mainPane.DoGUI(profilerProperty, this.m_SearchString, expandAll); profilerProperty.Cleanup(); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); ProfilerProperty profilerProperty2 = this.CreateProperty(true); ProfilerProperty detailedProperty = mainPane.GetDetailedProperty(profilerProperty2); profilerProperty2.Cleanup(); if (detailedProperty != null) { detailPane.DoGUI(detailedProperty, string.Empty, expandAll); detailedProperty.Cleanup(); } else { ProfilerWindow.DrawEmptyCPUOrRenderingDetailPane(); } GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); } }
public void OnGUI() { GUILayout.BeginVertical(); SplitterGUILayout.BeginHorizontalSplit(m_Splitter, EditorStyles.toolbar); DrawHeader(); SplitterGUILayout.EndHorizontalSplit(); if (m_Root == null) { GUILayout.EndVertical(); return; } HandleKeyboard(); m_ScrollPosition = GUILayout.BeginScrollView(m_ScrollPosition, styles.background); int row = 0; foreach (MemoryElement memoryElement in m_Root.children) { DrawItem(memoryElement, ref row, 1); row++; } GUILayoutUtility.GetRect(0f, row * kRowHeight, GUILayout.ExpandWidth(true)); if (Event.current.type == EventType.Repaint) { m_VisibleHeight = GUIClip.visibleRect.height; } GUILayout.EndScrollView(); GUILayout.EndVertical(); }
public bool DoGUI(bool hasFocus) { bool enabled = GUI.enabled; if (ms_Style == null) { ms_Style = new Constants(); ms_Style.entryEven = new GUIStyle(ms_Style.entryEven); ms_Style.entryEven.padding.left = 3; ms_Style.entryOdd = new GUIStyle(ms_Style.entryOdd); ms_Style.entryOdd.padding.left = 3; ms_Style.label = new GUIStyle(ms_Style.label); ms_Style.boldLabel = new GUIStyle(ms_Style.boldLabel); ms_Style.label.padding.left = 3; ms_Style.boldLabel.padding.left = 3; ms_Style.boldLabel.padding.top = 0; ms_Style.boldLabel.padding.bottom = 0; this.DoLocalSelectionChange(); } EditorGUIUtility.SetIconSize(ms_IconSize); if ((Event.current.type == EventType.KeyDown) && (Event.current.keyCode == KeyCode.Escape)) { this.CancelShowCustomDiff(); Event.current.Use(); } SplitterGUILayout.BeginHorizontalSplit(this.m_HorSplit, new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }; Rect theRect = GUILayoutUtility.GetRect((float)0f, (float)0f, options); this.m_FileViewWin.DoGUI(this, theRect, hasFocus); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); this.WebLikeHistory(hasFocus); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); if (Event.current.type == EventType.Repaint) { Handles.color = Color.black; Handles.DrawLine(new Vector3((float)(this.m_HorSplit.realSizes[0] - 1), theRect.y, 0f), new Vector3((float)(this.m_HorSplit.realSizes[0] - 1), theRect.yMax, 0f)); Handles.DrawLine(new Vector3(0f, theRect.yMax, 0f), new Vector3((float)Screen.width, theRect.yMax, 0f)); } GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUI.enabled = (this.m_FileViewWin.SelType == ASHistoryFileView.SelectionType.DeletedItems) && enabled; if (GUILayout.Button(EditorGUIUtility.TextContent("Recover"), ms_Style.button, new GUILayoutOption[0])) { this.m_FileViewWin.DoRecover(); } GUILayout.FlexibleSpace(); if (this.m_InRevisionSelectMode) { GUI.enabled = enabled; GUILayout.Label(EditorGUIUtility.TextContent("Select revision to compare to"), ms_Style.boldLabel, new GUILayoutOption[0]); } GUILayout.Space(10f); GUI.enabled = this.IsComparableAssetSelected() && enabled; if (GUILayout.Button(EditorGUIUtility.TextContent("Compare to Local Version"), ms_Style.button, new GUILayoutOption[0])) { this.DoShowDiff(false, this.ChangeLogSelectionRev, -1); GUIUtility.ExitGUI(); } GUI.enabled = ((this.ChangeLogSelectionRev > 0) && (this.m_ChangeLogSelectionGUID != string.Empty)) && enabled; if (GUILayout.Button(EditorGUIUtility.TextContent("Download Selected File"), ms_Style.button, new GUILayoutOption[0])) { this.DownloadFile(); } GUILayout.Space(10f); GUI.enabled = (this.ChangeLogSelectionRev > 0) && enabled; if (GUILayout.Button((this.ChangeLogSelectionRev <= 0) ? "Revert Entire Project" : ("Revert Entire Project to " + this.ChangeLogSelectionRev), ms_Style.button, new GUILayoutOption[0])) { this.DoRevertProject(); } GUI.enabled = enabled; GUILayout.EndHorizontal(); GUILayout.Space(10f); if (!this.m_SplittersOk && (Event.current.type == EventType.Repaint)) { this.m_SplittersOk = true; HandleUtility.Repaint(); } EditorGUIUtility.SetIconSize(Vector2.zero); return(true); }
private void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { SplitterState horizontalSplitter = this.m_LayoutStripsOnTop.m_HorizontalSplitter; SplitterState verticalSplitter = this.m_LayoutStripsOnTop.m_VerticalSplitter; SplitterGUILayout.BeginVerticalSplit(verticalSplitter, new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); if (this.m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); } SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); if (!this.m_GroupsRenderedAboveSections) { GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); } SplitterGUILayout.EndHorizontalSplit(); SplitterGUILayout.EndVerticalSplit(); float y = (float)((!this.m_GroupsRenderedAboveSections) ? (17 + verticalSplitter.realSizes[0]) : 17); float height = (float)((!this.m_GroupsRenderedAboveSections) ? verticalSplitter.realSizes[1] : verticalSplitter.realSizes[0]); float y2 = (float)(this.m_GroupsRenderedAboveSections ? (17 + verticalSplitter.realSizes[0]) : 17); float num = (float)(this.m_GroupsRenderedAboveSections ? verticalSplitter.realSizes[1] : verticalSplitter.realSizes[0]); Rect rect = new Rect(0f, y, base.position.width, height); Rect totalRectOfSections = new Rect(0f, rect.yMax, base.position.width, base.position.height - rect.height); Rect[] array = new Rect[this.m_SectionOrder.Length]; for (int i = 0; i < array.Length; i++) { float x = (i <= 0) ? 0f : array[i - 1].xMax; array[i] = new Rect(x, y2, (float)horizontalSplitter.realSizes[i], num - 12f); } Rect[] expr_1F2_cp_0 = array; int expr_1F2_cp_1 = 0; expr_1F2_cp_0[expr_1F2_cp_1].x = expr_1F2_cp_0[expr_1F2_cp_1].x + 8f; Rect[] expr_20B_cp_0 = array; int expr_20B_cp_1 = 0; expr_20B_cp_0[expr_20B_cp_1].width = expr_20B_cp_0[expr_20B_cp_1].width - 12f; Rect[] expr_229_cp_0 = array; int expr_229_cp_1 = array.Length - 1; expr_229_cp_0[expr_229_cp_1].x = expr_229_cp_0[expr_229_cp_1].x + 4f; Rect[] expr_247_cp_0 = array; int expr_247_cp_1 = array.Length - 1; expr_247_cp_0[expr_247_cp_1].width = expr_247_cp_0[expr_247_cp_1].width - 12f; for (int j = 1; j < array.Length - 1; j++) { Rect[] expr_26A_cp_0 = array; int expr_26A_cp_1 = j; expr_26A_cp_0[expr_26A_cp_1].x = expr_26A_cp_0[expr_26A_cp_1].x + 4f; Rect[] expr_284_cp_0 = array; int expr_284_cp_1 = j; expr_284_cp_0[expr_284_cp_1].width = expr_284_cp_0[expr_284_cp_1].width - 8f; } this.DoSections(totalRectOfSections, array, this.m_SectionOrder); this.m_ChannelStripView.OnGUI(rect, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem); EditorGUI.DrawRect(new Rect(0f, (float)(17 + verticalSplitter.realSizes[0] - 1), base.position.width, 1f), new Color(0f, 0f, 0f, 0.4f)); }
public void UpdateGUI() { SplitterGUILayout.BeginHorizontalSplit(this.horSplit, new GUILayoutOption[0]); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label(this.totalUpdates, this.constants.title, new GUILayoutOption[0]); IEnumerator enumerator = ListViewGUILayout.ListView(this.lv, GUIStyle.none, new GUILayoutOption[0]).GetEnumerator(); try { while (enumerator.MoveNext()) { ListViewElement current = (ListViewElement)enumerator.Current; Rect position = current.position; position.x++; position.y++; if (Event.current.type == EventType.Repaint) { if ((current.row % 2) == 0) { this.constants.entryEven.Draw(position, false, false, false, false); } else { this.constants.entryOdd.Draw(position, false, false, false, false); } } GUILayout.BeginVertical((current.row != this.lv.row) ? this.constants.entryNormal : this.constants.entrySelected, new GUILayoutOption[0]); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(50f) }; GUILayout.Label(this.messageFirstLines[current.row], this.constants.serverUpdateLog, options); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MinWidth(100f) }; GUILayout.Label(this.changesets[current.row].changeset.ToString() + " " + this.changesets[current.row].date, this.constants.serverUpdateInfo, optionArray2); GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.Width((float)this.maxNickLength) }; GUILayout.Label(this.changesets[current.row].owner, this.constants.serverUpdateInfo, optionArray3); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } if (this.lv.selectionChanged) { this.SetSelectedRevisionLine(this.lv.row); } GUILayout.EndVertical(); SplitterGUILayout.BeginVerticalSplit(this.vertSplit, new GUILayoutOption[0]); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label("Changeset", this.constants.title, new GUILayoutOption[0]); int num = -1; int file = -1; IEnumerator enumerator2 = ListViewGUILayout.ListView(this.pv.lv, GUIStyle.none, new GUILayoutOption[0]).GetEnumerator(); try { while (enumerator2.MoveNext()) { ChangeFlags changeFlags; ListViewElement element2 = (ListViewElement)enumerator2.Current; if ((num == -1) && !this.pv.IndexToFolderAndFile(element2.row, ref num, ref file)) { return; } ParentViewFolder folder = this.pv.folders[num]; if (ListViewGUILayout.HasMouseDown(element2.position)) { if (Event.current.clickCount == 2) { if (!this.isDirSelected && (this.selectedGUID != string.Empty)) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } } else { this.pv.lv.scrollPos = ListViewShared.ListViewScrollToRow(this.pv.lv.ilvState, element2.row); this.DoSelect(num, file, element2.row); } } else if (ListViewGUILayout.HasMouseDown(element2.position, 1)) { if (this.lv.row != element2.row) { this.DoSelect(num, file, element2.row); } if (!this.isDirSelected && (this.selectedGUID != string.Empty)) { GUIUtility.hotControl = 0; Rect rect2 = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f); EditorUtility.DisplayCustomMenu(rect2, this.dropDownMenuItems, null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null); Event.current.Use(); } } if ((element2.row == this.pv.lv.row) && (Event.current.type == EventType.Repaint)) { this.constants.entrySelected.Draw(element2.position, false, false, false, false); } if (file != -1) { Texture2D cachedIcon = AssetDatabase.GetCachedIcon(folder.name + "/" + folder.files[file].name) as Texture2D; if (cachedIcon == null) { cachedIcon = InternalEditorUtility.GetIconForFile(folder.files[file].name); } GUILayout.Label(new GUIContent(folder.files[file].name, cachedIcon), this.constants.element, new GUILayoutOption[0]); changeFlags = folder.files[file].changeFlags; } else { GUILayout.Label(folder.name, this.constants.header, new GUILayoutOption[0]); changeFlags = folder.changeFlags; } GUIContent badgeNew = null; if (this.HasFlag(changeFlags, ChangeFlags.Undeleted) || this.HasFlag(changeFlags, ChangeFlags.Created)) { badgeNew = ASMainWindow.constants.badgeNew; } else if (this.HasFlag(changeFlags, ChangeFlags.Deleted)) { badgeNew = ASMainWindow.constants.badgeDelete; } else if (this.HasFlag(changeFlags, ChangeFlags.Renamed) || this.HasFlag(changeFlags, ChangeFlags.Moved)) { badgeNew = ASMainWindow.constants.badgeMove; } if ((badgeNew != null) && (Event.current.type == EventType.Repaint)) { Rect rect3 = new Rect(((element2.position.x + element2.position.width) - badgeNew.image.width) - 5f, (element2.position.y + (element2.position.height / 2f)) - (badgeNew.image.height / 2), (float)badgeNew.image.width, (float)badgeNew.image.height); EditorGUIUtility.SetIconSize(Vector2.zero); GUIStyle.none.Draw(rect3, badgeNew, false, false, false, false); EditorGUIUtility.SetIconSize(this.iconSize); } this.pv.NextFileFolder(ref num, ref file); } } finally { IDisposable disposable2 = enumerator2 as IDisposable; if (disposable2 != null) { disposable2.Dispose(); } } if (this.pv.lv.selectionChanged && (this.selectedGUID != string.Empty)) { if (this.selectedGUID != AssetServer.GetRootGUID()) { AssetServer.SetSelectionFromGUID(this.selectedGUID); } else { AssetServer.SetSelectionFromGUID(string.Empty); } } if ((GUIUtility.keyboardControl == this.pv.lv.ID) && (((Event.current.type == EventType.KeyDown) && (Event.current.keyCode == KeyCode.Return)) && (!this.isDirSelected && (this.selectedGUID != string.Empty)))) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } GUILayout.EndVertical(); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label("Update Message", this.constants.title, new GUILayoutOption[0]); GUILayout.TextArea((this.lv.row < 0) ? "" : this.changesets[this.lv.row].message, this.constants.wwText, new GUILayoutOption[0]); GUILayout.EndVertical(); SplitterGUILayout.EndVerticalSplit(); SplitterGUILayout.EndHorizontalSplit(); }
internal void DrawUIPane(ProfilerWindow win, ProfilerArea profilerArea, UISystemProfilerChart detailsChart) { this.InitIfNeeded(win); EditorGUILayout.BeginVertical(new GUILayoutOption[0]); if (this.m_DetachedPreview != null && !this.m_DetachedPreview) { this.m_DetachedPreview = null; } bool flag = this.m_DetachedPreview; if (!flag) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.m_TreePreviewHorizontalSplitState, new GUILayoutOption[0]); } Rect controlRect = EditorGUILayout.GetControlRect(new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); controlRect.yMin -= EditorGUIUtility.standardVerticalSpacing; this.m_TreeViewControl.property = win.CreateProperty(); if (!this.m_TreeViewControl.property.frameDataReady) { this.m_TreeViewControl.property.Cleanup(); this.m_TreeViewControl.property = null; GUI.Label(controlRect, UISystemProfiler.Styles.noData); } else { int activeVisibleFrameIndex = win.GetActiveVisibleFrameIndex(); if (this.m_UGUIProfilerTreeViewState != null && this.m_UGUIProfilerTreeViewState.lastFrame != activeVisibleFrameIndex) { this.currentFrame = ProfilerDriver.lastFrameIndex - activeVisibleFrameIndex; this.m_TreeViewControl.Reload(); } this.m_TreeViewControl.OnGUI(controlRect); this.m_TreeViewControl.property.Cleanup(); } if (!flag) { using (new EditorGUILayout.VerticalScope(new GUILayoutOption[0])) { using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar, new GUILayoutOption[] { GUILayout.ExpandWidth(true) })) { flag = GUILayout.Button(UISystemProfiler.Styles.contentDetachRender, EditorStyles.toolbarButton, new GUILayoutOption[] { GUILayout.Width(75f) }); if (flag) { this.m_DetachedPreview = EditorWindow.GetWindow <UISystemPreviewWindow>(); this.m_DetachedPreview.profiler = this; this.m_DetachedPreview.Show(); } UISystemProfiler.DrawPreviewToolbarButtons(); } this.DrawRenderUI(); } GUILayout.EndHorizontal(); SplitterGUILayout.EndHorizontalSplit(); EditorGUI.DrawRect(new Rect((float)this.m_TreePreviewHorizontalSplitState.realSizes[0] + controlRect.xMin, controlRect.y, 1f, controlRect.height), UISystemProfiler.Styles.separatorColor); } EditorGUILayout.EndVertical(); if (this.m_DetachedPreview) { this.m_DetachedPreview.Repaint(); } }
private void DoNamingConflictsGUI() { bool enabled = GUI.enabled; bool shift = Event.current.shift; bool actionKey = EditorGUI.actionKey; GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.Label("The following assets have the same name as an existing asset on the server.\nPlease select which one to rename before continuing the update.", new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUI.enabled = (this.lv2HasSelection && enabled); if (GUILayout.Button(ASUpdateConflictResolveWindow.nameConflictButtonTexts[0], this.constants.ButtonLeft, new GUILayoutOption[0])) { this.ResolveSelectedNamingConflicts(NameConflictResolution.RenameLocal); } if (GUILayout.Button(ASUpdateConflictResolveWindow.nameConflictButtonTexts[1], this.constants.ButtonRight, new GUILayoutOption[0])) { this.ResolveSelectedNamingConflicts(NameConflictResolution.RenameRemote); } GUI.enabled = enabled; GUILayout.EndHorizontal(); GUILayout.Space(5f); SplitterGUILayout.BeginHorizontalSplit(this.lvHeaderSplit2, new GUILayoutOption[0]); GUILayout.Box("Action", this.constants.lvHeader, new GUILayoutOption[0]); GUILayout.Box("Asset", this.constants.lvHeader, new GUILayoutOption[0]); SplitterGUILayout.EndHorizontalSplit(); int row = this.lv2.row; bool flag = false; foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv2, this.constants.background, new GUILayoutOption[0])) { if (GUIUtility.keyboardControl == this.lv2.ID && Event.current.type == EventType.KeyDown && actionKey) { Event.current.Use(); } if (this.selectedLV2Items[listViewElement.row] && Event.current.type == EventType.Repaint) { this.constants.selected.Draw(listViewElement.position, false, false, false, false); } if (ListViewGUILayout.HasMouseUp(listViewElement.position)) { if (!shift && !actionKey) { flag |= ListViewGUILayout.MultiSelection(row, this.lv2.row, ref this.initialSelectedLV2Item, ref this.selectedLV2Items); } } else { if (ListViewGUILayout.HasMouseDown(listViewElement.position)) { if (!this.selectedLV2Items[listViewElement.row] || shift || actionKey) { flag |= ListViewGUILayout.MultiSelection(row, listViewElement.row, ref this.initialSelectedLV2Item, ref this.selectedLV2Items); } this.lv2.row = listViewElement.row; } } GUILayout.Label(this.namingResolutionString[(int)this.namingResolutions[listViewElement.row]], new GUILayoutOption[] { GUILayout.Width((float)this.lvHeaderSplit2.realSizes[0]), GUILayout.Height(18f) }); GUILayout.Label(new GUIContent(this.dNamingPaths[listViewElement.row], (!AssetServer.AssetIsDir(this.nameConflicts[listViewElement.row])) ? InternalEditorUtility.GetIconForFile(this.dNamingPaths[listViewElement.row]) : EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName)), new GUILayoutOption[] { GUILayout.Width((float)this.lvHeaderSplit2.realSizes[1]), GUILayout.Height(18f) }); } GUILayout.EndVertical(); if (GUIUtility.keyboardControl == this.lv2.ID) { if (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "SelectAll") { Event.current.Use(); } else { if (Event.current.type == EventType.ExecuteCommand && Event.current.commandName == "SelectAll") { for (int i = 0; i < this.selectedLV2Items.Length; i++) { this.selectedLV2Items[i] = true; } flag = true; Event.current.Use(); } } if (this.lv2.selectionChanged && !actionKey) { flag |= ListViewGUILayout.MultiSelection(row, this.lv2.row, ref this.initialSelectedLV2Item, ref this.selectedLV2Items); } } if (this.lv2.selectionChanged || flag) { this.mySelection = true; AssetServer.SetSelectionFromGUIDs(this.GetSelectedNamingGUIDs()); this.lv2HasSelection = this.HasTrue(ref this.selectedLV2Items); } }
private void OnGUI() { GUI.Label(new Rect(0f, 0f, base.position.width, 20f), "Heapshots are located here: " + Path.Combine(Application.dataPath, "Heapshots")); GUI.Label(new Rect(0f, 20f, base.position.width, 20f), "Currently opened: " + this.lastOpenedHeapshotFile); GUI.Label(new Rect(100f, 40f, base.position.width, 20f), "Profiling: " + this.lastOpenedProfiler); this.DoActiveProfilerButton(new Rect(0f, 40f, 100f, 30f)); if (GUI.Button(new Rect(0f, 70f, 200f, 20f), "CaptureHeapShot", EditorStyles.toolbarDropDown)) { ProfilerDriver.CaptureHeapshot(); } GUI.changed = false; this.selectedHeapshot = EditorGUI.Popup(new Rect(250f, 70f, 500f, 30f), "Click to open -->", this.selectedHeapshot, this.heapshotFiles.ToArray()); if (GUI.changed && this.heapshotFiles[this.selectedHeapshot].Length > 0) { this.OpenHeapshot(this.heapshotFiles[this.selectedHeapshot] + ".heapshot"); } GUILayout.BeginArea(new Rect(0f, 90f, base.position.width, 60f)); SplitterGUILayout.BeginHorizontalSplit(this.viewSplit, new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); string[] array = new string[] { "Roots", "All Objects" }; for (int i = 0; i < array.Length; i++) { bool flag = GUILayout.Toggle(this.currentTab == i, array[i], EditorStyles.toolbarButton, new GUILayoutOption[] { GUILayout.MaxHeight(16f) }); if (flag) { this.currentTab = i; } } GUILayout.EndHorizontal(); this.DoTitles(this.titleSplit1); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Label("Back trace references", EditorStyles.toolbarButton, new GUILayoutOption[] { GUILayout.MaxHeight(16f) }); this.DoTitles(this.titleSplit2); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); GUILayout.EndArea(); this.guiRect = new Rect(0f, 130f, (float)this.viewSplit.realSizes[0], 16f); float height = (float)this.GetItemCount(this.hsAllObjects) * 16f; Rect position = new Rect(this.guiRect.x, this.guiRect.y, this.guiRect.width, base.position.height - this.guiRect.y); this.leftViewScrollPosition = GUI.BeginScrollView(position, this.leftViewScrollPosition, new Rect(0f, 0f, position.width - 20f, height)); this.itemIndex = 0; this.guiRect.y = 0f; int num = this.currentTab; if (num != 0) { if (num == 1) { this.DoHeapshotObjects(this.hsAllObjects, this.titleSplit1, 0, new HeapshotWindow.OnSelect(this.OnSelectObject)); } } else { this.DoHeapshotObjects(this.hsRoots, this.titleSplit1, 0, new HeapshotWindow.OnSelect(this.OnSelectObject)); } GUI.EndScrollView(); this.guiRect = new Rect((float)this.viewSplit.realSizes[0], 130f, (float)this.viewSplit.realSizes[1], 16f); float height2 = (float)this.GetItemCount(this.hsBackTraceObjects) * 16f; position = new Rect(this.guiRect.x, this.guiRect.y, this.guiRect.width, base.position.height - this.guiRect.y); this.rightViewScrollPosition = GUI.BeginScrollView(position, this.rightViewScrollPosition, new Rect(0f, 0f, position.width - 20f, height2)); if (this.hsBackTraceObjects.Count > 0) { this.guiRect.y = 0f; this.itemIndex = 0; this.DoHeapshotObjects(this.hsBackTraceObjects, this.titleSplit2, 0, null); } GUI.EndScrollView(); }
internal void DrawUIPane(ProfilerWindow win, ProfilerArea profilerArea, UISystemProfilerChart detailsChart) { InitIfNeeded(win); EditorGUILayout.BeginVertical(); if (m_DetachedPreview != null && !m_DetachedPreview) { m_DetachedPreview = null; } bool detachPreview = m_DetachedPreview; if (!detachPreview) { GUILayout.BeginHorizontal(); // Horizontal render SplitterGUILayout.BeginHorizontalSplit(m_TreePreviewHorizontalSplitState); } var treeRect = EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); treeRect.yMin -= EditorGUIUtility.standardVerticalSpacing; m_TreeViewControl.property = win.CreateProperty(); if (!m_TreeViewControl.property.frameDataReady) { m_TreeViewControl.property.Cleanup(); m_TreeViewControl.property = null; GUI.Label(treeRect, Styles.noData); } else { var newVisibleFrame = win.GetActiveVisibleFrameIndex(); if (m_UGUIProfilerTreeViewState != null && m_UGUIProfilerTreeViewState.lastFrame != newVisibleFrame) { currentFrame = ProfilerDriver.lastFrameIndex - newVisibleFrame; m_TreeViewControl.Reload(); } m_TreeViewControl.OnGUI(treeRect); m_TreeViewControl.property.Cleanup(); } if (!detachPreview) { using (new EditorGUILayout.VerticalScope()) { using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar, GUILayout.ExpandWidth(true))) { detachPreview = GUILayout.Button(Styles.contentDetachRender, EditorStyles.toolbarButton, GUILayout.Width(75)); if (detachPreview) { m_DetachedPreview = EditorWindow.GetWindow <UISystemPreviewWindow>(); m_DetachedPreview.profiler = this; m_DetachedPreview.Show(); } DrawPreviewToolbarButtons(); } DrawRenderUI(); } GUILayout.EndHorizontal(); // Horizontal render SplitterGUILayout.EndHorizontalSplit(); // m_TreePreviewHorizontalSplitState // Draw separator EditorGUI.DrawRect( new Rect(m_TreePreviewHorizontalSplitState.realSizes[0] + treeRect.xMin, treeRect.y, 1, treeRect.height), Styles.separatorColor); } EditorGUILayout.EndVertical(); if (m_DetachedPreview) { m_DetachedPreview.Repaint(); } }
public void UpdateGUI() { SplitterGUILayout.BeginHorizontalSplit(this.horSplit); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label(this.totalUpdates, this.constants.title, new GUILayoutOption[0]); foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv, GUIStyle.none)) { Rect position = listViewElement.position; ++position.x; ++position.y; if (Event.current.type == EventType.Repaint) { if (listViewElement.row % 2 == 0) { this.constants.entryEven.Draw(position, false, false, false, false); } else { this.constants.entryOdd.Draw(position, false, false, false, false); } } GUILayout.BeginVertical(listViewElement.row != this.lv.row ? this.constants.entryNormal : this.constants.entrySelected, new GUILayoutOption[0]); GUILayout.Label(this.messageFirstLines[listViewElement.row], this.constants.serverUpdateLog, new GUILayoutOption[1] { GUILayout.MinWidth(50f) }); GUILayout.BeginHorizontal(); GUILayout.Label(this.changesets[listViewElement.row].changeset.ToString() + " " + this.changesets[listViewElement.row].date, this.constants.serverUpdateInfo, new GUILayoutOption[1] { GUILayout.MinWidth(100f) }); GUILayout.Label(this.changesets[listViewElement.row].owner, this.constants.serverUpdateInfo, new GUILayoutOption[1] { GUILayout.Width((float)this.maxNickLength) }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } if (this.lv.selectionChanged) { this.SetSelectedRevisionLine(this.lv.row); } GUILayout.EndVertical(); SplitterGUILayout.BeginVerticalSplit(this.vertSplit); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label("Changeset", this.constants.title, new GUILayoutOption[0]); int folder1 = -1; int file = -1; foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.pv.lv, GUIStyle.none)) { if (folder1 == -1 && !this.pv.IndexToFolderAndFile(listViewElement.row, ref folder1, ref file)) { return; } ParentViewFolder folder2 = this.pv.folders[folder1]; if (ListViewGUILayout.HasMouseDown(listViewElement.position)) { if (Event.current.clickCount == 2) { if (!this.isDirSelected && this.selectedGUID != string.Empty) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } } else { this.pv.lv.scrollPos = ListViewShared.ListViewScrollToRow((ListViewShared.InternalListViewState) this.pv.lv.ilvState, listViewElement.row); this.DoSelect(folder1, file, listViewElement.row); } } else if (ListViewGUILayout.HasMouseDown(listViewElement.position, 1)) { if (this.lv.row != listViewElement.row) { this.DoSelect(folder1, file, listViewElement.row); } if (!this.isDirSelected && this.selectedGUID != string.Empty) { GUIUtility.hotControl = 0; EditorUtility.DisplayCustomMenu(new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f), this.dropDownMenuItems, (int[])null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), (object)null); Event.current.Use(); } } if (listViewElement.row == this.pv.lv.row && Event.current.type == EventType.Repaint) { this.constants.entrySelected.Draw(listViewElement.position, false, false, false, false); } ChangeFlags changeFlags; if (file != -1) { Texture2D texture2D = AssetDatabase.GetCachedIcon(folder2.name + "/" + folder2.files[file].name) as Texture2D; if ((UnityEngine.Object)texture2D == (UnityEngine.Object)null) { texture2D = InternalEditorUtility.GetIconForFile(folder2.files[file].name); } GUILayout.Label(new GUIContent(folder2.files[file].name, (Texture)texture2D), this.constants.element, new GUILayoutOption[0]); changeFlags = folder2.files[file].changeFlags; } else { GUILayout.Label(folder2.name, this.constants.header, new GUILayoutOption[0]); changeFlags = folder2.changeFlags; } GUIContent content = (GUIContent)null; if (this.HasFlag(changeFlags, ChangeFlags.Undeleted) || this.HasFlag(changeFlags, ChangeFlags.Created)) { content = ASMainWindow.constants.badgeNew; } else if (this.HasFlag(changeFlags, ChangeFlags.Deleted)) { content = ASMainWindow.constants.badgeDelete; } else if (this.HasFlag(changeFlags, ChangeFlags.Renamed) || this.HasFlag(changeFlags, ChangeFlags.Moved)) { content = ASMainWindow.constants.badgeMove; } if (content != null && Event.current.type == EventType.Repaint) { Rect position = new Rect((float)((double)listViewElement.position.x + (double)listViewElement.position.width - (double)content.image.width - 5.0), listViewElement.position.y + listViewElement.position.height / 2f - (float)(content.image.height / 2), (float)content.image.width, (float)content.image.height); EditorGUIUtility.SetIconSize(Vector2.zero); GUIStyle.none.Draw(position, content, false, false, false, false); EditorGUIUtility.SetIconSize(this.iconSize); } this.pv.NextFileFolder(ref folder1, ref file); } if (this.pv.lv.selectionChanged && this.selectedGUID != string.Empty) { if (this.selectedGUID != AssetServer.GetRootGUID()) { AssetServer.SetSelectionFromGUID(this.selectedGUID); } else { AssetServer.SetSelectionFromGUID(string.Empty); } } if (GUIUtility.keyboardControl == this.pv.lv.ID && Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return && !this.isDirSelected) && this.selectedGUID != string.Empty) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } GUILayout.EndVertical(); GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]); GUILayout.Label("Update Message", this.constants.title, new GUILayoutOption[0]); GUILayout.TextArea(this.lv.row < 0 ? string.Empty : this.changesets[this.lv.row].message, this.constants.wwText, new GUILayoutOption[0]); GUILayout.EndVertical(); SplitterGUILayout.EndVerticalSplit(); SplitterGUILayout.EndHorizontalSplit(); }
void LayoutWithStripsOnRightSideOneScrollBar(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap) { // Do layouting SplitterState horizontalState = m_LayoutStripsOnRight.m_HorizontalSplitter; SplitterGUILayout.BeginHorizontalSplit(horizontalState, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); SplitterGUILayout.EndHorizontalSplit(); float column1Width = horizontalState.realSizes[0]; float column2Width = position.width - column1Width; Rect column1Rect = new Rect(0, EditorGUI.kWindowToolbarHeight, column1Width, position.height - EditorGUI.kWindowToolbarHeight); Rect column2Rect = new Rect(column1Width, EditorGUI.kWindowToolbarHeight, column2Width, column1Rect.height); // Column1 // Background color for mixertree and views (if needed) if (EditorGUIUtility.isProSkin) { EditorGUI.DrawRect(column1Rect, EditorGUIUtility.isProSkin ? new Color(0.19f, 0.19f, 0.19f) : new Color(0.6f, 0.6f, 0.6f, 0f)); } // Rects for sections float spacing = AudioMixerDrawUtils.kSpaceBetweenSections; Rect[] sectionRects = new Rect[m_SectionOrder.Length]; const float xPos = 0f; float yPos = 0f; for (int i = 0; i < m_SectionOrder.Length; i++) { yPos += spacing; if (i > 0) { yPos += sectionRects[i - 1].height; } sectionRects[i] = new Rect(xPos, yPos, column1Rect.width, GetHeightOfSection(m_SectionOrder[i])); // Adjust for left and right margins const float margin = 4f; sectionRects[i].x += margin; sectionRects[i].width -= margin * 2; } Rect contentRect = new Rect(0, 0, 1, sectionRects.Last().yMax); // Adjust for scrollbar if (contentRect.height > column1Rect.height) { for (int i = 0; i < sectionRects.Length; i++) { sectionRects[i].width -= 14; } } // Scroll view m_SectionsScrollPosition = GUI.BeginScrollView(column1Rect, m_SectionsScrollPosition, contentRect); DoSections(column1Rect, sectionRects, m_SectionOrder); GUI.EndScrollView(); // Column2 m_ChannelStripView.OnGUI(column2Rect, m_ShowReferencedBuses, m_ShowBusConnections, m_ShowBusConnectionsOfSelection, allGroups, effectMap, m_SortGroupsAlphabetically, m_ShowDeveloperOverlays, m_GroupTree.ScrollToItem); // Vertical line (split) EditorGUI.DrawRect(new Rect(column1Rect.xMax - 1, EditorGUI.kWindowToolbarHeight, 1, position.height - EditorGUI.kWindowToolbarHeight), EditorGUIUtility.isProSkin ? new Color(0.15f, 0.15f, 0.15f) : new Color(0.6f, 0.6f, 0.6f)); }
private void DoDownloadConflictsGUI() { bool enabled = GUI.enabled; bool shift = Event.current.shift; bool actionKey = EditorGUI.actionKey; GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Label("The following assets have been changed both on the server and in the local project.\nPlease select a conflict resolution for each before continuing the update.", new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUI.enabled = (this.lv1HasSelection && enabled); if (GUILayout.Button(ASUpdateConflictResolveWindow.conflictButtonTexts[0], this.constants.ButtonLeft, new GUILayoutOption[0])) { this.ResolveSelectedDownloadConflicts(DownloadResolution.SkipAsset); } if (GUILayout.Button(ASUpdateConflictResolveWindow.conflictButtonTexts[1], this.constants.ButtonMiddle, new GUILayoutOption[0])) { this.ResolveSelectedDownloadConflicts(DownloadResolution.TrashMyChanges); } if (GUILayout.Button(ASUpdateConflictResolveWindow.conflictButtonTexts[2], this.constants.ButtonMiddle, new GUILayoutOption[0])) { this.ResolveSelectedDownloadConflicts(DownloadResolution.TrashServerChanges); } if (!this.enableMergeButton) { GUI.enabled = false; } if (GUILayout.Button(ASUpdateConflictResolveWindow.conflictButtonTexts[3], this.constants.ButtonRight, new GUILayoutOption[0])) { this.ResolveSelectedDownloadConflicts(DownloadResolution.Merge); } GUI.enabled = enabled; GUILayout.EndHorizontal(); GUILayout.Space(5f); SplitterGUILayout.BeginHorizontalSplit(this.lvHeaderSplit1, new GUILayoutOption[0]); GUILayout.Box("Action", this.constants.lvHeader, new GUILayoutOption[0]); GUILayout.Box("Asset", this.constants.lvHeader, new GUILayoutOption[0]); SplitterGUILayout.EndHorizontalSplit(); int row = this.lv1.row; bool flag = false; foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv1, this.constants.background, new GUILayoutOption[0])) { if (GUIUtility.keyboardControl == this.lv1.ID && Event.current.type == EventType.KeyDown && actionKey) { Event.current.Use(); } if (this.selectedLV1Items[listViewElement.row] && Event.current.type == EventType.Repaint) { this.constants.selected.Draw(listViewElement.position, false, false, false, false); } if (ListViewGUILayout.HasMouseUp(listViewElement.position)) { if (!shift && !actionKey) { flag |= ListViewGUILayout.MultiSelection(row, this.lv1.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items); } } else { if (ListViewGUILayout.HasMouseDown(listViewElement.position)) { if (Event.current.clickCount == 2 && !AssetServer.AssetIsDir(this.downloadConflicts[listViewElement.row])) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } else { if (!this.selectedLV1Items[listViewElement.row] || shift || actionKey) { flag |= ListViewGUILayout.MultiSelection(row, listViewElement.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items); } this.lv1.row = listViewElement.row; } } else { if (ListViewGUILayout.HasMouseDown(listViewElement.position, 1)) { if (!this.selectedLV1Items[listViewElement.row]) { flag = true; for (int i = 0; i < this.selectedLV1Items.Length; i++) { this.selectedLV1Items[i] = false; } this.lv1.selectionChanged = true; this.selectedLV1Items[listViewElement.row] = true; this.lv1.row = listViewElement.row; } GUIUtility.hotControl = 0; Rect position = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f); EditorUtility.DisplayCustomMenu(position, this.dropDownMenuItems, null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null); Event.current.Use(); } } } GUILayout.Label(this.downloadResolutionString[(int)this.downloadResolutions[listViewElement.row]], new GUILayoutOption[] { GUILayout.Width((float)this.lvHeaderSplit1.realSizes[0]), GUILayout.Height(18f) }); if (this.deletionConflict[listViewElement.row] && Event.current.type == EventType.Repaint) { GUIContent badgeDelete = ASMainWindow.constants.badgeDelete; Rect position2 = new Rect(listViewElement.position.x + (float)this.lvHeaderSplit1.realSizes[0] - (float)badgeDelete.image.width - 5f, listViewElement.position.y + listViewElement.position.height / 2f - (float)(badgeDelete.image.height / 2), (float)badgeDelete.image.width, (float)badgeDelete.image.height); EditorGUIUtility.SetIconSize(Vector2.zero); GUIStyle.none.Draw(position2, badgeDelete, false, false, false, false); EditorGUIUtility.SetIconSize(this.iconSize); } GUILayout.Label(new GUIContent(this.dConflictPaths[listViewElement.row], (!AssetServer.AssetIsDir(this.downloadConflicts[listViewElement.row])) ? InternalEditorUtility.GetIconForFile(this.dConflictPaths[listViewElement.row]) : EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName)), new GUILayoutOption[] { GUILayout.Width((float)this.lvHeaderSplit1.realSizes[1]), GUILayout.Height(18f) }); } GUILayout.EndVertical(); if (GUIUtility.keyboardControl == this.lv1.ID) { if (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "SelectAll") { Event.current.Use(); } else { if (Event.current.type == EventType.ExecuteCommand && Event.current.commandName == "SelectAll") { for (int j = 0; j < this.selectedLV1Items.Length; j++) { this.selectedLV1Items[j] = true; } flag = true; Event.current.Use(); } } if (this.lv1.selectionChanged && !actionKey) { flag |= ListViewGUILayout.MultiSelection(row, this.lv1.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items); } else { if (GUIUtility.keyboardControl == this.lv1.ID && Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return && !AssetServer.AssetIsDir(this.downloadConflicts[this.lv1.row])) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } } } if (this.lv1.selectionChanged || flag) { this.mySelection = true; AssetServer.SetSelectionFromGUIDs(this.GetSelectedGUIDs()); this.lv1HasSelection = this.HasTrue(ref this.selectedLV1Items); this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged(); } }
public bool DoGUI() { bool enabled = GUI.enabled; if (ASServerAdminWindow.constants == null) { ASServerAdminWindow.constants = new ASMainWindow.Constants(); ASServerAdminWindow.constants.toggleSize = ASServerAdminWindow.constants.toggle.CalcSize(new GUIContent("X")); } if (this.resetKeyboardControl) { this.resetKeyboardControl = false; GUIUtility.keyboardControl = 0; } GUILayout.BeginHorizontal(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Server Connection", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(ASServerAdminWindow.constants.contentBox, new GUILayoutOption[0]); Event current = Event.current; if (current.type == EventType.KeyDown && current.keyCode == KeyCode.Return && this.CanPerformCurrentAction()) { this.PerformCurrentAction(); } if (current.type == EventType.KeyDown && current.keyCode == KeyCode.Escape && this.currAction != ASServerAdminWindow.Action.Main) { this.currAction = ASServerAdminWindow.Action.Main; current.Use(); } GUILayout.BeginHorizontal(); this.server = EditorGUILayout.TextField("Server Address:", this.server, new GUILayoutOption[0]); this.ServersPopup(); GUILayout.EndHorizontal(); this.user = EditorGUILayout.TextField("User Name:", this.user, new GUILayoutOption[0]); this.password = EditorGUILayout.PasswordField("Password:"******"Connect", ASServerAdminWindow.constants.smallButton, new GUILayoutOption[0])) { this.PerformCurrentAction(); } GUI.enabled = enabled; GUILayout.EndHorizontal(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Label(AssetServer.GetAssetServerError(), ASServerAdminWindow.constants.errorLabel, new GUILayoutOption[0]); } GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Admin Actions", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(ASServerAdminWindow.constants.contentBox, new GUILayoutOption[0]); this.ActionBox(); GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Project", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv, ASServerAdminWindow.constants.background)) { if (listViewElement.row == this.lv.row && Event.current.type == EventType.Repaint) { ASServerAdminWindow.constants.entrySelected.Draw(listViewElement.position, false, false, false, false); } GUILayout.Label(this.databases[listViewElement.row].name); } if (this.lv.selectionChanged) { if (this.lv.row > -1) { this.projectSelected = true; } this.currAction = ASServerAdminWindow.Action.Main; this.DoGetUsers(); } GUILayout.EndVertical(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.lvSplit); GUILayout.Box(string.Empty, ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("User", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Full Name", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Email", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); SplitterGUILayout.EndHorizontalSplit(); int left = EditorStyles.label.margin.left; foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv2, ASServerAdminWindow.constants.background)) { if (listViewElement.row == this.lv2.row && Event.current.type == EventType.Repaint) { ASServerAdminWindow.constants.entrySelected.Draw(listViewElement.position, false, false, false, false); } bool flag1 = this.users[listViewElement.row].enabled != 0; bool flag2 = GUI.Toggle(new Rect(listViewElement.position.x + 2f, listViewElement.position.y - 1f, ASServerAdminWindow.constants.toggleSize.x, ASServerAdminWindow.constants.toggleSize.y), flag1, string.Empty); GUILayout.Space(ASServerAdminWindow.constants.toggleSize.x); if (flag1 != flag2 && AssetServer.AdminSetUserEnabled(this.databases[this.lv.row].dbName, this.users[listViewElement.row].userName, this.users[listViewElement.row].fullName, this.users[listViewElement.row].email, !flag2 ? 0 : 1)) { this.users[listViewElement.row].enabled = !flag2 ? 0 : 1; } GUILayout.Label(this.users[listViewElement.row].userName, new GUILayoutOption[1] { GUILayout.Width((float)(this.lvSplit.realSizes[1] - left)) }); GUILayout.Label(this.users[listViewElement.row].fullName, new GUILayoutOption[1] { GUILayout.Width((float)(this.lvSplit.realSizes[2] - left)) }); GUILayout.Label(this.users[listViewElement.row].email); } if (this.lv2.selectionChanged) { if (this.lv2.row > -1) { this.userSelected = true; } if (this.currAction == ASServerAdminWindow.Action.SetPassword) { this.currAction = ASServerAdminWindow.Action.Main; } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(10f); if (!this.splittersOk && Event.current.type == EventType.Repaint) { this.splittersOk = true; this.parentWin.Repaint(); } return(true); }
public void OnAnimEditorGUI(EditorWindow parent, Rect position) { m_DopeSheet.m_Owner = parent; m_OwnerWindow = parent; m_Position = position; if (!m_Initialized) { Initialize(); } m_State.OnGUI(); if (m_State.disabled && controlInterface.recording) { m_State.StopRecording(); } SynchronizeLayout(); using (new EditorGUI.DisabledScope(m_State.disabled || m_State.animatorIsOptimized)) { OverlayEventOnGUI(); GUILayout.BeginHorizontal(); SplitterGUILayout.BeginHorizontalSplit(m_HorizontalSplitter); // Left side GUILayout.BeginVertical(); // First row of controls GUILayout.BeginHorizontal(EditorStyles.toolbarButton); PlayControlsOnGUI(); GUILayout.EndHorizontal(); // Second row of controls GUILayout.BeginHorizontal(EditorStyles.toolbarButton); LinkOptionsOnGUI(); ClipSelectionDropDownOnGUI(); GUILayout.FlexibleSpace(); FrameRateInputFieldOnGUI(); AddKeyframeButtonOnGUI(); AddEventButtonOnGUI(); GUILayout.EndHorizontal(); HierarchyOnGUI(); // Bottom row of controls GUILayout.BeginHorizontal(AnimationWindowStyles.miniToolbar); TabSelectionOnGUI(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); // Right side GUILayout.BeginVertical(); // Acquire Rects Rect timerulerRect = GUILayoutUtility.GetRect(contentWidth, kLayoutRowHeight); Rect eventsRect = GUILayoutUtility.GetRect(contentWidth, kLayoutRowHeight); Rect contentLayoutRect = GUILayoutUtility.GetRect(contentWidth, contentWidth, 0f, float.MaxValue, GUILayout.ExpandHeight(true)); // MainContent must be done first since it resizes the Zoomable area. MainContentOnGUI(contentLayoutRect); TimeRulerOnGUI(timerulerRect); EventLineOnGUI(eventsRect); GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); GUILayout.EndHorizontal(); // Overlay OverlayOnGUI(contentLayoutRect); RenderEventTooltip(); } }