Exemplo n.º 1
0
 public ProfilerHierarchyGUI(IProfilerWindowController window, string columnSettingsName, ProfilerColumn[] columnsToShow, string[] columnNames, bool detailPane, ProfilerColumn sort)
 {
     this.m_Window = window;
     this.m_ColumnNames = columnNames;
     this.m_ColumnSettingsName = columnSettingsName;
     this.m_ColumnsToShow = columnsToShow;
     this.m_DetailPane = detailPane;
     this.m_SortType = sort;
     this.m_HeaderContent = new GUIContent[columnNames.Length];
     this.m_Splitter = null;
     for (int i = 0; i < this.m_HeaderContent.Length; i++)
     {
         this.m_HeaderContent[i] = !this.m_ColumnNames[i].StartsWith("|") ? new GUIContent(this.m_ColumnNames[i]) : EditorGUIUtility.IconContent("ProfilerColumn." + columnsToShow[i].ToString(), this.m_ColumnNames[i]);
     }
     if (columnsToShow.Length != columnNames.Length)
     {
         throw new ArgumentException("Number of columns to show does not match number of column names.");
     }
     this.m_SearchHeader = new GUIContent("Search");
     this.m_VisibleColumns = new bool[columnNames.Length];
     for (int j = 0; j < this.m_VisibleColumns.Length; j++)
     {
         this.m_VisibleColumns[j] = true;
     }
     this.m_SearchResults = new SearchResults();
     this.m_SearchResults.Init(100);
     this.m_Window.Repaint();
 }
 public static void BeginSplit(SplitterState state, GUIStyle style, bool vertical, params GUILayoutOption[] options)
 {
   SplitterGUILayout.GUISplitterGroup guiSplitterGroup = (SplitterGUILayout.GUISplitterGroup) GUILayoutUtility.BeginLayoutGroup(style, (GUILayoutOption[]) null, typeof (SplitterGUILayout.GUISplitterGroup));
   state.ID = GUIUtility.GetControlID(SplitterGUILayout.splitterHash, FocusType.Native);
   switch (Event.current.GetTypeForControl(state.ID))
   {
     case EventType.MouseDown:
       if (Event.current.button != 0 || Event.current.clickCount != 1)
         break;
       int num1 = !guiSplitterGroup.isVertical ? (int) guiSplitterGroup.rect.x : (int) guiSplitterGroup.rect.y;
       int num2 = !guiSplitterGroup.isVertical ? (int) Event.current.mousePosition.x : (int) Event.current.mousePosition.y;
       for (int index = 0; index < state.relativeSizes.Length - 1; ++index)
       {
         if ((!guiSplitterGroup.isVertical ? new Rect(state.xOffset + (float) num1 + (float) state.realSizes[index] - (float) (state.splitSize / 2), guiSplitterGroup.rect.y, (float) state.splitSize, guiSplitterGroup.rect.height) : new Rect(state.xOffset + guiSplitterGroup.rect.x, (float) (num1 + state.realSizes[index] - state.splitSize / 2), guiSplitterGroup.rect.width, (float) state.splitSize)).Contains(Event.current.mousePosition))
         {
           state.splitterInitialOffset = num2;
           state.currentActiveSplitter = index;
           GUIUtility.hotControl = state.ID;
           Event.current.Use();
           break;
         }
         num1 += state.realSizes[index];
       }
       break;
     case EventType.MouseUp:
       if (GUIUtility.hotControl != state.ID)
         break;
       GUIUtility.hotControl = 0;
       state.currentActiveSplitter = -1;
       state.RealToRelativeSizes();
       Event.current.Use();
       break;
     case EventType.MouseDrag:
       if (GUIUtility.hotControl != state.ID || state.currentActiveSplitter < 0)
         break;
       int num3 = !guiSplitterGroup.isVertical ? (int) Event.current.mousePosition.x : (int) Event.current.mousePosition.y;
       int diff = num3 - state.splitterInitialOffset;
       if (diff != 0)
       {
         state.splitterInitialOffset = num3;
         state.DoSplitter(state.currentActiveSplitter, state.currentActiveSplitter + 1, diff);
       }
       Event.current.Use();
       break;
     case EventType.Repaint:
       int num4 = !guiSplitterGroup.isVertical ? (int) guiSplitterGroup.rect.x : (int) guiSplitterGroup.rect.y;
       for (int index = 0; index < state.relativeSizes.Length - 1; ++index)
       {
         EditorGUIUtility.AddCursorRect(!guiSplitterGroup.isVertical ? new Rect(state.xOffset + (float) num4 + (float) state.realSizes[index] - (float) (state.splitSize / 2), guiSplitterGroup.rect.y, (float) state.splitSize, guiSplitterGroup.rect.height) : new Rect(state.xOffset + guiSplitterGroup.rect.x, (float) (num4 + state.realSizes[index] - state.splitSize / 2), guiSplitterGroup.rect.width, (float) state.splitSize), !guiSplitterGroup.isVertical ? MouseCursor.SplitResizeLeftRight : MouseCursor.ResizeVertical, state.ID);
         num4 += state.realSizes[index];
       }
       break;
     case EventType.Layout:
       guiSplitterGroup.state = state;
       guiSplitterGroup.resetCoords = false;
       guiSplitterGroup.isVertical = vertical;
       guiSplitterGroup.ApplyOptions(options);
       break;
   }
 }
Exemplo n.º 3
0
 public BaseInspectView(GUIViewDebuggerWindow guiViewDebuggerWindow)
 {
     float[] relativeSizes = new float[] { 80f, 20f };
     int[] minSizes = new int[] { 100, 100 };
     this.m_InstructionDetailStacktraceSplitter = new SplitterState(relativeSizes, minSizes, null);
     this.m_GuiViewDebuggerWindow = guiViewDebuggerWindow;
 }
Exemplo n.º 4
0
 public ASHistoryWindow(EditorWindow parent)
 {
     float[] relativeSizes = new float[] { 30f, 70f };
     int[] minSizes = new int[] { 60, 100 };
     this.m_HorSplit = new SplitterState(relativeSizes, minSizes, null);
     this.m_ScrollPos = Vector2.zero;
     this.m_RowHeight = 0x10;
     this.m_HistoryControlID = -1;
     this.m_ChangesetSelectionIndex = -1;
     this.m_AssetSelectionIndex = -1;
     this.m_ChangeLogSelectionRev = -1;
     this.m_Rev1ForCustomDiff = -1;
     this.m_ChangeLogSelectionGUID = string.Empty;
     this.m_ChangeLogSelectionAssetName = string.Empty;
     this.m_SelectedPath = string.Empty;
     this.m_SelectedGUID = string.Empty;
     this.m_DropDownMenuItems = new GUIContent[] { EditorGUIUtility.TextContent("Show History"), emptyGUIContent, EditorGUIUtility.TextContent("Compare to Local"), EditorGUIUtility.TextContent("Compare Binary to Local"), emptyGUIContent, EditorGUIUtility.TextContent("Compare to Another Revision"), EditorGUIUtility.TextContent("Compare Binary to Another Revision"), emptyGUIContent, EditorGUIUtility.TextContent("Download This File") };
     this.m_DropDownChangesetMenuItems = new GUIContent[] { EditorGUIUtility.TextContent("Revert Entire Project to This Changeset") };
     this.m_FileViewWin = new ASHistoryFileView();
     this.m_ParentWindow = parent;
     ASEditorBackend.SettingsIfNeeded();
     if (Selection.objects.Length != 0)
     {
         this.m_FileViewWin.SelType = ASHistoryFileView.SelectionType.Items;
     }
 }
 public GUIViewDebuggerWindow()
 {
     float[] relativeSizes = new float[] { 30f, 70f };
     int[] minSizes = new int[] { 0x20, 0x20 };
     this.m_InstructionListDetailSplitter = new SplitterState(relativeSizes, minSizes, null);
     this.m_InstructionModeView = new StyleDrawInspectView(this);
 }
Exemplo n.º 6
0
		protected virtual void SetupSplitter()
		{
			float[] array = new float[1];
			int[] array2 = new int[1];
			array[0] = 300f;
			array2[0] = 100;
			this.m_Splitter = new SplitterState(array, array2, null);
		}
 protected virtual void SetupSplitter()
 {
   float[] relativeSizes = new float[1];
   int[] minSizes = new int[1];
   relativeSizes[0] = 300f;
   minSizes[0] = 100;
   this.m_Splitter = new SplitterState(relativeSizes, minSizes, (int[]) null);
 }
Exemplo n.º 8
0
 public ConsoleWindow()
 {
     float[] relativeSizes = new float[] { 70f, 30f };
     int[] minSizes = new int[] { 0x20, 0x20 };
     this.spl = new SplitterState(relativeSizes, minSizes, null);
     base.position = new Rect(200f, 200f, 800f, 400f);
     this.m_ListView = new ListViewState(0, 0x20);
 }
Exemplo n.º 9
0
 public HeapshotWindow()
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     this.viewSplit = new SplitterState(relativeSizes, null, null);
     this.titleNames = new string[] { "Field Name", "Type", "Pointer", "Size", "References/Referenced" };
     this.titleSplit1 = new SplitterState(new float[] { 30f, 25f, 15f, 15f, 15f }, new int[] { 200, 200, 50, 50, 50 }, null);
     this.titleSplit2 = new SplitterState(new float[] { 30f, 25f, 15f, 15f, 15f }, new int[] { 200, 200, 50, 50, 50 }, null);
     this.selectedHeapshot = -1;
 }
Exemplo n.º 10
0
 private void DoHeapshotObjects(List<HeapshotUIObject> objects, SplitterState splitter, int indent, OnSelect onSelect)
 {
     if (objects != null)
     {
         Event current = Event.current;
         foreach (HeapshotUIObject obj2 in objects)
         {
             Rect position = new Rect(14f * indent, this.guiRect.y, 14f, this.guiRect.height);
             Rect[] rectArray = new Rect[this.titleNames.Length];
             float x = 14f * (indent + 1);
             for (int i = 0; i < rectArray.Length; i++)
             {
                 float width = (i != 0) ? ((float) splitter.realSizes[i]) : (splitter.realSizes[i] - x);
                 rectArray[i] = new Rect(x, this.guiRect.y, width, this.guiRect.height);
                 x += width;
             }
             if (current.type == EventType.Repaint)
             {
                 Rect rect2 = new Rect(0f, 16f * this.itemIndex, base.position.width, 16f);
                 (((this.itemIndex & 1) != 0) ? Styles.entryOdd : Styles.entryEven).Draw(rect2, GUIContent.none, false, false, this.itemIndex == this.selectedItem, false);
             }
             if (obj2.HasChildren)
             {
                 GUI.changed = false;
                 bool flag = GUI.Toggle(position, obj2.IsExpanded, GUIContent.none, Styles.foldout);
                 if (GUI.changed)
                 {
                     if (flag)
                     {
                         obj2.Expand();
                     }
                     else
                     {
                         obj2.Collapse();
                     }
                 }
             }
             GUI.changed = false;
             bool flag2 = GUI.Toggle(rectArray[0], this.itemIndex == this.selectedItem, obj2.Name, Styles.numberLabel);
             if (!obj2.IsDummyObject)
             {
                 GUI.Toggle(rectArray[1], this.itemIndex == this.selectedItem, obj2.TypeName, Styles.numberLabel);
                 GUI.Toggle(rectArray[2], this.itemIndex == this.selectedItem, "0x" + obj2.Code.ToString("X"), Styles.numberLabel);
                 GUI.Toggle(rectArray[3], this.itemIndex == this.selectedItem, obj2.Size.ToString(), Styles.numberLabel);
                 GUI.Toggle(rectArray[4], this.itemIndex == this.selectedItem, string.Format("{0} / {1}", obj2.ReferenceCount, obj2.InverseReferenceCount), Styles.numberLabel);
                 if ((GUI.changed && flag2) && (onSelect != null))
                 {
                     this.selectedItem = this.itemIndex;
                     onSelect(obj2);
                 }
             }
             this.itemIndex++;
             this.guiRect.y += 16f;
             this.DoHeapshotObjects(obj2.Children, splitter, indent + 1, onSelect);
         }
     }
 }
Exemplo n.º 11
0
 public ASMainWindow()
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     int[] minSizes = new int[] { 80, 80 };
     this.splitter = new SplitterState(relativeSizes, minSizes, null);
     this.commitMessage = string.Empty;
     this.lastRevertSelectionChanged = -1;
     base.position = new Rect(50f, 50f, 800f, 600f);
 }
Exemplo n.º 12
0
 private void SetupSplitter()
 {
   int[] realSizes = new int[this.children.Length];
   int[] minSizes = new int[this.children.Length];
   for (int index = 0; index < this.children.Length; ++index)
   {
     View child = this.children[index];
     realSizes[index] = !this.vertical ? (int) child.position.width : (int) child.position.height;
     minSizes[index] = !this.vertical ? (int) child.minSize.x : (int) child.minSize.y;
   }
   this.splitState = new SplitterState(realSizes, minSizes, (int[]) null);
   this.splitState.splitSize = 10;
 }
Exemplo n.º 13
0
		private void SetupSplitter()
		{
			int[] array = new int[base.children.Length];
			int[] array2 = new int[base.children.Length];
			for (int i = 0; i < base.children.Length; i++)
			{
				View view = base.children[i];
				array[i] = ((!this.vertical) ? ((int)view.position.width) : ((int)view.position.height));
				array2[i] = (int)((!this.vertical) ? view.minSize.x : view.minSize.y);
			}
			this.splitState = new SplitterState(array, array2, null);
			this.splitState.splitSize = 10;
		}
Exemplo n.º 14
0
 public ASMainWindow()
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     int[] minSizes = new int[] { 80, 80 };
     this.splitter = new SplitterState(relativeSizes, minSizes, null);
     this.committing = false;
     this.selectionChangedWhileCommitting = false;
     this.commitMessage = string.Empty;
     this.pvHasSelection = false;
     this.somethingDiscardableSelected = false;
     this.mySelection = false;
     this.focusCommitMessage = false;
     this.lastRevertSelectionChanged = -1;
     this.m_CheckedMaint = false;
     base.position = new Rect(50f, 50f, 800f, 600f);
 }
Exemplo n.º 15
0
 public ASCommitWindow(ASMainWindow parentWin, string[] guidsToTransfer)
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     int[] minSizes = new int[] { 50, 50 };
     this.horSplit = new SplitterState(relativeSizes, minSizes, null);
     float[] singleArray2 = new float[] { 60f, 30f };
     int[] numArray2 = new int[] { 0x20, 0x40 };
     this.vertSplit = new SplitterState(singleArray2, numArray2, null);
     this.description = "";
     this.scrollPos = Vector2.zero;
     this.lastTransferMovedDependencies = false;
     this.lastRevertSelectionChanged = -1;
     this.showReinitedWarning = -1;
     this.guidsToTransferToTheRightSide = guidsToTransfer;
     this.parentWin = parentWin;
     this.initialUpdate = true;
 }
Exemplo n.º 16
0
 public ASUpdateWindow(ASMainWindow parentWin, Changeset[] changesets)
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     int[] minSizes = new int[] { 50, 50 };
     this.horSplit = new SplitterState(relativeSizes, minSizes, null);
     float[] singleArray2 = new float[] { 60f, 30f };
     int[] numArray2 = new int[] { 0x20, 0x20 };
     this.vertSplit = new SplitterState(singleArray2, numArray2, null);
     this.changesets = changesets;
     this.parentWin = parentWin;
     this.lv = new ListViewState(changesets.Length, 5);
     this.pv.lv = new ListViewState(0, 5);
     this.messageFirstLines = new string[changesets.Length];
     for (int i = 0; i < changesets.Length; i++)
     {
         char[] separator = new char[] { '\n' };
         this.messageFirstLines[i] = changesets[i].message.Split(separator)[0];
     }
     this.totalUpdates = changesets.Length.ToString() + ((changesets.Length != 1) ? " Updates" : " Update");
 }
Exemplo n.º 17
0
 public ProfilerWindow()
 {
     float[] relativeSizes = new float[] { 50f, 50f };
     int[] minSizes = new int[] { 50, 50 };
     this.m_VertSplit = new SplitterState(relativeSizes, minSizes, null);
     float[] singleArray2 = new float[] { 70f, 30f };
     int[] numArray2 = new int[] { 450, 50 };
     this.m_ViewSplit = new SplitterState(singleArray2, numArray2, null);
     float[] singleArray3 = new float[] { 20f, 80f };
     int[] numArray3 = new int[] { 100, 100 };
     this.m_NetworkSplit = new SplitterState(singleArray3, numArray3, null);
     this.m_Recording = true;
     this.m_AttachProfilerUI = new AttachProfilerUI();
     this.m_GraphPos = Vector2.zero;
     this.m_PaneScroll = new Vector2[9];
     this.m_CurrentFrame = -1;
     this.m_LastFrameFromTick = -1;
     this.m_PrevLastFrame = -1;
     this.m_LastAudioProfilerFrame = -1;
     this.m_ChartOldMax = new float[] { -1f, -1f };
     this.m_ChartMaxClamp = 70000f;
     this.msgNames = new string[] { "UserMessage", "ObjectDestroy", "ClientRpc", "ObjectSpawn", "Owner", "Command", "LocalPlayerTransform", "SyncEvent", "SyncVars", "SyncList", "ObjectSpawnScene", "NetworkInfo", "SpawnFinished", "ObjectHide", "CRC", "ClientAuthority" };
     this.msgFoldouts = new bool[] { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false };
 }
Exemplo n.º 18
0
        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 = SplitterState.FromAbsolute(new float[] { 65, 35 }, new float[] { 85, 105 }, null);
            }

            if (m_LayoutStripsOnTop.m_HorizontalSplitter == null || m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnTop.m_HorizontalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 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 = SplitterState.FromAbsolute(new float[] { 30, 70 }, new float[] { 160, 160 }, null);
            }

            if (m_LayoutStripsOnRight.m_VerticalSplitter == null || m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnRight.m_VerticalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 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;
        }
Exemplo n.º 19
0
 public void DisplayedItemsChanged()
 {
   float[] relativeSizes = new float[2];
   bool flag1 = this.sharedChangesets != null && this.sharedChangesets.Length != 0;
   bool flag2 = this.pv.lv.totalRows != 0;
   if (flag1 && flag2 || !flag1 && !flag2)
   {
     relativeSizes[0] = relativeSizes[1] = 0.5f;
   }
   else
   {
     relativeSizes[0] = !flag1 ? 0.0f : 1f;
     relativeSizes[1] = !flag2 ? 0.0f : 1f;
   }
   this.splitter = new SplitterState(relativeSizes, new int[2]{ 80, 80 }, (int[]) null);
   this.DoSelectionChange();
 }
		private void SetColumnVisible(int index, bool enabled)
		{
			this.SetupSplitter();
			if (index == 0)
			{
				return;
			}
			if (this.m_VisibleColumns[index] == enabled)
			{
				return;
			}
			this.m_VisibleColumns[index] = enabled;
			int num = 0;
			for (int i = 0; i < index; i++)
			{
				if (this.ColIsVisible(i))
				{
					num++;
				}
			}
			if (enabled)
			{
				ArrayUtility.Insert<float>(ref this.m_Splitter.relativeSizes, num, this.m_SplitterRelativeSizes[index]);
				ArrayUtility.Insert<int>(ref this.m_Splitter.minSizes, num, this.m_SplitterMinWidths[index]);
			}
			else
			{
				ArrayUtility.RemoveAt<float>(ref this.m_Splitter.relativeSizes, num);
				ArrayUtility.RemoveAt<int>(ref this.m_Splitter.minSizes, num);
			}
			this.m_Splitter = new SplitterState(this.m_Splitter.relativeSizes, this.m_Splitter.minSizes, null);
			this.SaveColumns();
		}
Exemplo n.º 21
0
 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();
 }
Exemplo n.º 22
0
		private void DoHeapshotObjects(List<HeapshotWindow.HeapshotUIObject> objects, SplitterState splitter, int indent, HeapshotWindow.OnSelect onSelect)
		{
			if (objects == null)
			{
				return;
			}
			Event current = Event.current;
			foreach (HeapshotWindow.HeapshotUIObject current2 in objects)
			{
				Rect position = new Rect(14f * (float)indent, this.guiRect.y, 14f, this.guiRect.height);
				Rect[] array = new Rect[this.titleNames.Length];
				float num = 14f * (float)(indent + 1);
				for (int i = 0; i < array.Length; i++)
				{
					float num2 = (i != 0) ? ((float)splitter.realSizes[i]) : ((float)splitter.realSizes[i] - num);
					array[i] = new Rect(num, this.guiRect.y, num2, this.guiRect.height);
					num += num2;
				}
				if (current.type == EventType.Repaint)
				{
					Rect position2 = new Rect(0f, 16f * (float)this.itemIndex, base.position.width, 16f);
					GUIStyle gUIStyle = ((this.itemIndex & 1) != 0) ? HeapshotWindow.Styles.entryOdd : HeapshotWindow.Styles.entryEven;
					gUIStyle.Draw(position2, GUIContent.none, false, false, this.itemIndex == this.selectedItem, false);
				}
				if (current2.HasChildren)
				{
					GUI.changed = false;
					bool flag = GUI.Toggle(position, current2.IsExpanded, GUIContent.none, HeapshotWindow.Styles.foldout);
					if (GUI.changed)
					{
						if (flag)
						{
							current2.Expand();
						}
						else
						{
							current2.Collapse();
						}
					}
				}
				GUI.changed = false;
				bool flag2 = GUI.Toggle(array[0], this.itemIndex == this.selectedItem, current2.Name, HeapshotWindow.Styles.numberLabel);
				if (!current2.IsDummyObject)
				{
					GUI.Toggle(array[1], this.itemIndex == this.selectedItem, current2.TypeName, HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[2], this.itemIndex == this.selectedItem, "0x" + current2.Code.ToString("X"), HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[3], this.itemIndex == this.selectedItem, current2.Size.ToString(), HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[4], this.itemIndex == this.selectedItem, string.Format("{0} / {1}", current2.ReferenceCount, current2.InverseReferenceCount), HeapshotWindow.Styles.numberLabel);
					if (GUI.changed && flag2 && onSelect != null)
					{
						this.selectedItem = this.itemIndex;
						onSelect(current2);
					}
				}
				this.itemIndex++;
				this.guiRect.y = this.guiRect.y + 16f;
				this.DoHeapshotObjects(current2.Children, splitter, indent + 1, onSelect);
			}
		}
Exemplo n.º 23
0
        public void Cleanup()
        {
            SplitView splitView = base.parent as SplitView;

            if (base.children.Length == 1 && splitView != null)
            {
                View view = base.children[0];
                view.position = base.position;
                if (base.parent != null)
                {
                    base.parent.AddChild(view, base.parent.IndexOfChild(this));
                    base.parent.RemoveChild(this);
                    if (splitView)
                    {
                        splitView.Cleanup();
                    }
                    view.position = base.position;
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        UnityEngine.Object.DestroyImmediate(this);
                    }
                    return;
                }
                if (view is SplitView)
                {
                    this.RemoveChild(view);
                    base.window.mainView = view;
                    view.position        = new Rect(0f, 0f, view.window.position.width, base.window.position.height);
                    view.Reflow();
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        UnityEngine.Object.DestroyImmediate(this);
                    }
                    return;
                }
            }
            if (splitView)
            {
                splitView.Cleanup();
                splitView = (base.parent as SplitView);
                if (splitView && splitView.vertical == this.vertical)
                {
                    int    num      = new List <View>(base.parent.children).IndexOf(this);
                    View[] children = base.children;
                    for (int i = 0; i < children.Length; i++)
                    {
                        View view2 = children[i];
                        splitView.AddChild(view2, num++);
                        view2.position = new Rect(base.position.x + view2.position.x, base.position.y + view2.position.y, view2.position.width, view2.position.height);
                    }
                }
            }
            if (base.children.Length == 0)
            {
                if (base.parent == null && base.window != null)
                {
                    base.window.Close();
                }
                else
                {
                    ICleanuppable cleanuppable = base.parent as ICleanuppable;
                    if (base.parent is SplitView)
                    {
                        ((SplitView)base.parent).RemoveChildNice(this);
                        if (!Unsupported.IsDestroyScriptableObject(this))
                        {
                            UnityEngine.Object.DestroyImmediate(this, true);
                        }
                    }
                    cleanuppable.Cleanup();
                }
                return;
            }
            this.splitState = null;
            this.Reflow();
        }
Exemplo n.º 24
0
 public static void BeginHorizontalSplit(SplitterState state, params GUILayoutOption[] options)
 {
     BeginSplit(state, GUIStyle.none, false, options);
 }
 public static void BeginVerticalSplit(SplitterState state, GUIStyle style, params GUILayoutOption[] options)
 {
   SplitterGUILayout.BeginSplit(state, style, true, options);
 }
Exemplo n.º 26
0
 public static void BeginVerticalSplit(SplitterState state, GUIStyle style, params GUILayoutOption[] options)
 {
     BeginSplit(state, style, true, options);
 }
Exemplo n.º 27
0
        public static void BeginSplit(SplitterState state, GUIStyle style, bool vertical, params GUILayoutOption[] options)
        {
            int num;
            GUISplitterGroup group = (GUISplitterGroup)GUILayoutUtility.BeginLayoutGroup(style, null, typeof(GUISplitterGroup));

            state.ID = GUIUtility.GetControlID(splitterHash, FocusType.Native);
            switch (Event.current.type)
            {
            case EventType.MouseDown:
                if ((Event.current.button == 0) && (Event.current.clickCount == 1))
                {
                    int num2 = !group.isVertical ? ((int)group.rect.x) : ((int)group.rect.y);
                    num = !group.isVertical ? ((int)Event.current.mousePosition.x) : ((int)Event.current.mousePosition.y);
                    for (int i = 0; i < (state.relativeSizes.Length - 1); i++)
                    {
                        Rect rect = !group.isVertical ? new Rect(((state.xOffset + num2) + state.realSizes[i]) - (state.splitSize / 2), group.rect.y, (float)state.splitSize, group.rect.height) : new Rect(state.xOffset + group.rect.x, (float)((num2 + state.realSizes[i]) - (state.splitSize / 2)), group.rect.width, (float)state.splitSize);
                        if (rect.Contains(Event.current.mousePosition))
                        {
                            state.splitterInitialOffset = num;
                            state.currentActiveSplitter = i;
                            GUIUtility.hotControl       = state.ID;
                            Event.current.Use();
                            break;
                        }
                        num2 += state.realSizes[i];
                    }
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == state.ID)
                {
                    GUIUtility.hotControl       = 0;
                    state.currentActiveSplitter = -1;
                    state.RealToRelativeSizes();
                    Event.current.Use();
                }
                break;

            case EventType.MouseDrag:
                if ((GUIUtility.hotControl == state.ID) && (state.currentActiveSplitter >= 0))
                {
                    num = !group.isVertical ? ((int)Event.current.mousePosition.x) : ((int)Event.current.mousePosition.y);
                    int diff = num - state.splitterInitialOffset;
                    if (diff != 0)
                    {
                        state.splitterInitialOffset = num;
                        state.DoSplitter(state.currentActiveSplitter, state.currentActiveSplitter + 1, diff);
                    }
                    Event.current.Use();
                }
                break;

            case EventType.Repaint:
            {
                int num5 = !group.isVertical ? ((int)group.rect.x) : ((int)group.rect.y);
                for (int j = 0; j < (state.relativeSizes.Length - 1); j++)
                {
                    Rect position = !group.isVertical ? new Rect(((state.xOffset + num5) + state.realSizes[j]) - (state.splitSize / 2), group.rect.y, (float)state.splitSize, group.rect.height) : new Rect(state.xOffset + group.rect.x, (float)((num5 + state.realSizes[j]) - (state.splitSize / 2)), group.rect.width, (float)state.splitSize);
                    EditorGUIUtility.AddCursorRect(position, !group.isVertical ? MouseCursor.SplitResizeLeftRight : MouseCursor.ResizeVertical, state.ID);
                    num5 += state.realSizes[j];
                }
                break;
            }

            case EventType.Layout:
                group.state       = state;
                group.resetCoords = false;
                group.isVertical  = vertical;
                group.ApplyOptions(options);
                break;
            }
        }
Exemplo n.º 28
0
        public static void BeginSplit(SplitterState state, GUIStyle style, bool vertical, params GUILayoutOption[] options)
        {
            float pos;
            var   g = (GUISplitterGroup)GUILayoutUtility.BeginLayoutGroup(style, null, typeof(GUISplitterGroup));

            state.ID = GUIUtility.GetControlID(splitterHash, FocusType.Passive);

            switch (Event.current.GetTypeForControl(state.ID))
            {
            case EventType.Layout:
            {
                g.state       = state;
                g.resetCoords = false;
                g.isVertical  = vertical;
                g.ApplyOptions(options);
                break;
            }

            case EventType.MouseDown:
            {
                if ((Event.current.button == 0) && (Event.current.clickCount == 1))
                {
                    float cursor = GUIUtility.RoundToPixelGrid(g.isVertical ? g.rect.y : g.rect.x);
                    pos = GUIUtility.RoundToPixelGrid(g.isVertical ? Event.current.mousePosition.y : Event.current.mousePosition.x);

                    for (int i = 0; i < state.relativeSizes.Length - 1; i++)
                    {
                        Rect splitterRect = g.isVertical ?
                                            new Rect(state.xOffset + g.rect.x, cursor + state.realSizes[i] - state.splitSize / 2, g.rect.width, state.splitSize) :
                                            new Rect(state.xOffset + cursor + state.realSizes[i] - state.splitSize / 2, g.rect.y, state.splitSize, g.rect.height);

                        if (GUIUtility.HitTest(splitterRect, Event.current))
                        {
                            state.splitterInitialOffset = pos;
                            state.currentActiveSplitter = i;
                            GUIUtility.hotControl       = state.ID;
                            Event.current.Use();
                            break;
                        }

                        cursor = GUIUtility.RoundToPixelGrid(cursor + state.realSizes[i]);
                    }
                }
                break;
            }

            case EventType.MouseDrag:
            {
                if ((GUIUtility.hotControl == state.ID) && (state.currentActiveSplitter >= 0))
                {
                    pos = g.isVertical ? Event.current.mousePosition.y : Event.current.mousePosition.x;
                    GUIUtility.RoundToPixelGrid(pos);
                    float diff = pos - state.splitterInitialOffset;

                    if (diff != 0)
                    {
                        state.splitterInitialOffset = pos;
                        state.DoSplitter(state.currentActiveSplitter, state.currentActiveSplitter + 1, diff);
                    }

                    Event.current.Use();
                }
                break;
            }

            case EventType.MouseUp:
            {
                if (GUIUtility.hotControl == state.ID)
                {
                    GUIUtility.hotControl       = 0;
                    state.currentActiveSplitter = -1;
                    state.RealToRelativeSizes();
                    Event.current.Use();
                }
                break;
            }

            case EventType.Repaint:
            {
                float cursor = GUIUtility.RoundToPixelGrid(g.isVertical ? g.rect.y : g.rect.x);

                for (var i = 0; i < state.relativeSizes.Length - 1; i++)
                {
                    var splitterRect = g.isVertical ?
                                       new Rect(state.xOffset + g.rect.x, cursor + state.realSizes[i] - state.splitSize / 2, g.rect.width, state.splitSize) :
                                       new Rect(state.xOffset + cursor + state.realSizes[i] - state.splitSize / 2, g.rect.y, state.splitSize, g.rect.height);

                    EditorGUIUtility.AddCursorRect(splitterRect, g.isVertical ? MouseCursor.ResizeVertical : MouseCursor.SplitResizeLeftRight, state.ID);

                    cursor += state.realSizes[i];
                }
            }

            break;
            }
        }
Exemplo n.º 29
0
        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));
        }
Exemplo n.º 30
0
        public void Cleanup()
        {
            SplitView parent = base.parent as SplitView;

            if ((base.children.Length == 1) && (parent != null))
            {
                View child = base.children[0];
                child.position = base.position;
                if (base.parent != null)
                {
                    base.parent.AddChild(child, base.parent.IndexOfChild(this));
                    base.parent.RemoveChild(this);
                    if (parent != null)
                    {
                        parent.Cleanup();
                    }
                    child.position = base.position;
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        Object.DestroyImmediate(this);
                    }
                    return;
                }
                if (child is SplitView)
                {
                    this.RemoveChild(child);
                    base.window.mainView = child;
                    child.position       = new Rect(0f, 0f, child.window.position.width, base.window.position.height);
                    child.Reflow();
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        Object.DestroyImmediate(this);
                    }
                    return;
                }
            }
            if (parent != null)
            {
                parent.Cleanup();
                parent = base.parent as SplitView;
                if ((parent != null) && (parent.vertical == this.vertical))
                {
                    int index = new List <View>(base.parent.children).IndexOf(this);
                    foreach (View view3 in base.children)
                    {
                        parent.AddChild(view3, index++);
                        view3.position = new Rect(base.position.x + view3.position.x, base.position.y + view3.position.y, view3.position.width, view3.position.height);
                    }
                }
            }
            if (base.children.Length == 0)
            {
                if ((base.parent == null) && (base.window != null))
                {
                    base.window.Close();
                }
                else
                {
                    ICleanuppable cleanuppable = base.parent as ICleanuppable;
                    if (base.parent is SplitView)
                    {
                        ((SplitView)base.parent).RemoveChildNice(this);
                        if (!Unsupported.IsDestroyScriptableObject(this))
                        {
                            Object.DestroyImmediate(this, true);
                        }
                    }
                    cleanuppable.Cleanup();
                }
            }
            else
            {
                this.splitState = null;
                this.Reflow();
            }
        }
Exemplo n.º 31
0
 private void DrawMemoryPane(SplitterState splitter)
 {
     this.DrawMemoryToolbar();
     if (this.m_ShowDetailedMemoryPane == ProfilerMemoryView.Simple)
     {
         this.DrawOverviewText(ProfilerArea.Memory);
     }
     else
     {
         this.DrawDetailedMemoryPane(splitter);
     }
 }
Exemplo n.º 32
0
 public override void AddChild(View child, int idx)
 {
     base.AddChild(child, idx);
     this.ChildrenMinMaxChanged();
     this.splitState = null;
 }
Exemplo n.º 33
0
        public bool PerformDrop(EditorWindow w, DropInfo di, Vector2 screenPos)
        {
            int      userData = (int)di.userData;
            DockArea child    = ScriptableObject.CreateInstance <DockArea>();
            Rect     r        = di.rect;

            switch (userData)
            {
            case -1:
            case -2:
            case -3:
            {
                bool flag  = userData == -2;
                bool flag2 = userData == -1;
                this.splitState = null;
                if ((this.vertical == flag2) || (base.children.Length < 2))
                {
                    this.vertical = flag2;
                    r.x          -= base.screenPosition.x;
                    r.y          -= base.screenPosition.y;
                    this.MakeRoomForRect(r);
                    this.AddChild(child, !flag ? base.children.Length : 0);
                    child.position = r;
                }
                else
                {
                    SplitView view     = ScriptableObject.CreateInstance <SplitView>();
                    Rect      position = base.position;
                    view.vertical = flag2;
                    view.position = new Rect(position.x, position.y, position.width, position.height);
                    if (base.window.mainView == this)
                    {
                        base.window.mainView = view;
                    }
                    else
                    {
                        base.parent.AddChild(view, base.parent.IndexOfChild(this));
                    }
                    view.AddChild(this);
                    base.position = new Rect(0f, 0f, position.width, position.height);
                    Rect rect3 = r;
                    rect3.x -= base.screenPosition.x;
                    rect3.y -= base.screenPosition.y;
                    view.MakeRoomForRect(rect3);
                    child.position = rect3;
                    view.AddChild(child, !flag ? 1 : 0);
                }
                break;
            }

            default:
                if (userData < 0x3e8)
                {
                    Rect rect4 = r;
                    rect4.x -= base.screenPosition.x;
                    rect4.y -= base.screenPosition.y;
                    this.MakeRoomForRect(rect4);
                    this.AddChild(child, userData);
                    child.position = rect4;
                }
                else
                {
                    int index = userData % 0x3e8;
                    if (base.children.Length != 1)
                    {
                        SplitView view2 = ScriptableObject.CreateInstance <SplitView>();
                        view2.vertical = !this.vertical;
                        Rect rect5 = base.children[index].position;
                        view2.AddChild(base.children[index]);
                        this.AddChild(view2, index);
                        view2.position = rect5;
                        float num3 = 0f;
                        rect5.y = num3;
                        rect5.x = num3;
                        view2.children[0].position = rect5;
                        Rect rect6 = r;
                        rect6.x -= view2.screenPosition.x;
                        rect6.y -= view2.screenPosition.y;
                        view2.MakeRoomForRect(rect6);
                        view2.AddChild(child, (userData >= 0x7d0) ? 1 : 0);
                        child.position = rect6;
                    }
                    else
                    {
                        this.vertical = !this.vertical;
                        Rect rect7 = r;
                        rect7.x -= base.screenPosition.x;
                        rect7.y -= base.screenPosition.y;
                        this.MakeRoomForRect(rect7);
                        this.AddChild(child, (userData != 0x3e8) ? 1 : 0);
                        child.position = rect7;
                    }
                }
                break;
            }
            DockArea.s_OriginalDragSource.RemoveTab(w);
            w.m_Parent = child;
            child.AddTab(w);
            this.Reflow();
            RecalcMinMaxAndReflowAll(this);
            child.MakeVistaDWMHappyDance();
            return(true);
        }
Exemplo n.º 34
0
        private void DoHeapshotObjects(List <HeapshotWindow.HeapshotUIObject> objects, SplitterState splitter, int indent, HeapshotWindow.OnSelect onSelect)
        {
            if (objects == null)
            {
                return;
            }
            Event current = Event.current;

            foreach (HeapshotWindow.HeapshotUIObject current2 in objects)
            {
                Rect   position = new Rect(14f * (float)indent, this.guiRect.y, 14f, this.guiRect.height);
                Rect[] array    = new Rect[this.titleNames.Length];
                float  num      = 14f * (float)(indent + 1);
                for (int i = 0; i < array.Length; i++)
                {
                    float num2 = (i != 0) ? ((float)splitter.realSizes[i]) : ((float)splitter.realSizes[i] - num);
                    array[i] = new Rect(num, this.guiRect.y, num2, this.guiRect.height);
                    num     += num2;
                }
                if (current.type == EventType.Repaint)
                {
                    Rect     position2 = new Rect(0f, 16f * (float)this.itemIndex, base.position.width, 16f);
                    GUIStyle gUIStyle  = ((this.itemIndex & 1) != 0) ? HeapshotWindow.Styles.entryOdd : HeapshotWindow.Styles.entryEven;
                    gUIStyle.Draw(position2, GUIContent.none, false, false, this.itemIndex == this.selectedItem, false);
                }
                if (current2.HasChildren)
                {
                    GUI.changed = false;
                    bool flag = GUI.Toggle(position, current2.IsExpanded, GUIContent.none, HeapshotWindow.Styles.foldout);
                    if (GUI.changed)
                    {
                        if (flag)
                        {
                            current2.Expand();
                        }
                        else
                        {
                            current2.Collapse();
                        }
                    }
                }
                GUI.changed = false;
                bool flag2 = GUI.Toggle(array[0], this.itemIndex == this.selectedItem, current2.Name, HeapshotWindow.Styles.numberLabel);
                if (!current2.IsDummyObject)
                {
                    GUI.Toggle(array[1], this.itemIndex == this.selectedItem, current2.TypeName, HeapshotWindow.Styles.numberLabel);
                    GUI.Toggle(array[2], this.itemIndex == this.selectedItem, "0x" + current2.Code.ToString("X"), HeapshotWindow.Styles.numberLabel);
                    GUI.Toggle(array[3], this.itemIndex == this.selectedItem, current2.Size.ToString(), HeapshotWindow.Styles.numberLabel);
                    GUI.Toggle(array[4], this.itemIndex == this.selectedItem, string.Format("{0} / {1}", current2.ReferenceCount, current2.InverseReferenceCount), HeapshotWindow.Styles.numberLabel);
                    if (GUI.changed && flag2 && onSelect != null)
                    {
                        this.selectedItem = this.itemIndex;
                        onSelect(current2);
                    }
                }
                this.itemIndex++;
                this.guiRect.y = this.guiRect.y + 16f;
                this.DoHeapshotObjects(current2.Children, splitter, indent + 1, onSelect);
            }
        }
 public ASUpdateConflictResolveWindow(string[] conflicting)
 {
     float[] relativeSizes = new float[] { 20f, 80f };
     int[] minSizes = new int[] { 100, 100 };
     this.lvHeaderSplit1 = new SplitterState(relativeSizes, minSizes, null);
     float[] singleArray2 = new float[] { 20f, 80f };
     int[] numArray2 = new int[] { 100, 100 };
     this.lvHeaderSplit2 = new SplitterState(singleArray2, numArray2, null);
     this.dropDownMenuItems = new string[] { "Compare", "Compare Binary" };
     this.downloadConflicts = new string[0];
     this.nameConflicts = new string[0];
     this.dConflictPaths = new string[0];
     this.dNamingPaths = new string[0];
     this.downloadResolutions = new DownloadResolution[0];
     this.namingResolutions = new NameConflictResolution[0];
     this.enableMergeButton = true;
     this.iconSize = new Vector2(16f, 16f);
     this.downloadResolutionString = new string[] { "Unresolved", "Skip Asset", "Discard My Changes", "Ignore Server Changes", "Merge" };
     this.namingResolutionString = new string[] { "Unresolved", "Rename Local Asset", "Rename Server Asset" };
     this.downloadConflictsToResolve = 0;
     ArrayList list = new ArrayList();
     ArrayList list2 = new ArrayList();
     ArrayList list3 = new ArrayList();
     ArrayList list4 = new ArrayList();
     for (int i = 0; i < conflicting.Length; i++)
     {
         AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
         if (statusGUID == AssetStatus.Conflict)
         {
             list.Add(conflicting[i]);
             DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
             list2.Add(downloadResolution);
             if (downloadResolution == DownloadResolution.Unresolved)
             {
                 this.downloadConflictsToResolve++;
             }
         }
         if ((AssetServer.GetPathNameConflict(conflicting[i]) != null) && (statusGUID != AssetStatus.ServerOnly))
         {
             list4.Add(conflicting[i]);
             NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
             list3.Add(nameConflictResolution);
             if (nameConflictResolution == NameConflictResolution.Unresolved)
             {
                 this.downloadConflictsToResolve++;
             }
         }
     }
     this.downloadConflicts = list.ToArray(typeof(string)) as string[];
     this.downloadResolutions = list2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
     this.namingResolutions = list3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
     this.nameConflicts = list4.ToArray(typeof(string)) as string[];
     this.enableContinueButton = this.downloadConflictsToResolve == 0;
     this.dConflictPaths = new string[this.downloadConflicts.Length];
     this.deletionConflict = new bool[this.downloadConflicts.Length];
     for (int j = 0; j < this.downloadConflicts.Length; j++)
     {
         if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
         {
             this.dConflictPaths[j] = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
             this.deletionConflict[j] = true;
         }
         else
         {
             this.dConflictPaths[j] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
             this.deletionConflict[j] = false;
         }
     }
     this.dNamingPaths = new string[this.nameConflicts.Length];
     for (int k = 0; k < this.nameConflicts.Length; k++)
     {
         this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
     }
     this.showDownloadConflicts = this.downloadConflicts.Length > 0;
     this.showNamingConflicts = this.nameConflicts.Length > 0;
     this.lv1.totalRows = this.downloadConflicts.Length;
     this.lv2.totalRows = this.nameConflicts.Length;
     this.selectedLV1Items = new bool[this.downloadConflicts.Length];
     this.selectedLV2Items = new bool[this.nameConflicts.Length];
     this.DoSelectionChange();
 }
Exemplo n.º 36
0
        /// clean up this view & propagate down
        public void Cleanup()
        {
            // if I'm a one-view splitview, I can propagate my child up and kill myself

            SplitView sp = parent as SplitView;

            if (children.Length == 1 && sp != null)
            {
                View c = children[0];
                c.position = position;
                if (parent != null)
                {
                    parent.AddChild(c, parent.IndexOfChild(this));
                    parent.RemoveChild(this);
                    if (sp)
                    {
                        sp.Cleanup();
                    }
                    c.position = position;
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        DestroyImmediate(this);
                    }
                    return;
                }
                else if (c is SplitView)
                {
                    RemoveChild(c);
                    window.rootView = c;
                    c.position      = new Rect(0, 0, c.window.position.width, window.position.height);
                    c.Reflow();
                    if (!Unsupported.IsDestroyScriptableObject(this))
                    {
                        DestroyImmediate(this);
                    }
                    return;
                }
            }

            if (sp)
            {
                sp.Cleanup();
                // the parent might have moved US up and gotten rid of itself
                sp = parent as SplitView;
                if (sp)
                {
                    // If the parent has the same orientation as us, we can move our views up and kill ourselves
                    if (sp.vertical == vertical)
                    {
                        int idx = new List <View>(parent.children).IndexOf(this);
                        foreach (View child in children)
                        {
                            sp.AddChild(child, idx++);
                            child.position = new Rect(position.x + child.position.x, position.y + child.position.y, child.position.width, child.position.height);
                        }
                    }
                }
            }
            if (children.Length == 0)
            {
                if (parent == null && window != null)
                {
                    // if we're root in the window, we'll remove ourselves
                    window.Close();
                }
                else
                {
                    ICleanuppable ic = parent as ICleanuppable;
                    if (parent is SplitView)
                    {
                        ((SplitView)parent).RemoveChildNice(this);
                        if (!Unsupported.IsDestroyScriptableObject(this))
                        {
                            DestroyImmediate(this, true);
                        }
                    }
                    else
                    {
                        // This is we're root in the main window.
                        // We want to stay, but tell the parent (MainWindow) to Cleanup, so he can reduce us to zero-size
                        /*                  parent.RemoveChild (this);*/
                    }
                    ic.Cleanup();
                }
                return;
            }
            else
            {
                splitState = null;
                Reflow();
            }
        }
Exemplo n.º 37
0
		public void Awake()
		{
			if (this.state == null)
			{
				this.state = new AnimationWindowState();
				this.state.m_ShowCurveEditor = false;
				this.state.m_AnimationWindow = this;
			}
			this.state.timeArea = null;
			base.minSize = new Vector2(400f, 200f);
			this.m_HorizontalSplitter = new SplitterState(new float[]
			{
				250f,
				10000f
			}, new int[]
			{
				250,
				150
			}, null);
			this.m_HorizontalSplitter.realSizes[0] = 300;
			base.wantsMouseMove = true;
			AnimationWindow.m_Selected = new AnimationSelection[0];
			if (this.m_ExpandedFoldouts == null)
			{
				this.m_ExpandedFoldouts = new SerializedStringTable();
			}
			if (this.m_ChosenAnimated == null)
			{
				this.m_ChosenAnimated = new SerializedStringTable();
			}
			if (this.m_ChosenClip == null)
			{
				this.m_ChosenClip = new SerializedStringTable();
			}
			this.m_CurveEditor = new CurveEditor(new Rect(base.position.x, base.position.y, 500f, 200f), new CurveWrapper[0], false);
			this.SetGridColors();
			this.m_CurveEditor.m_TimeUpdater = this;
			this.m_CurveEditor.m_DefaultBounds = new Bounds(new Vector3(1f, 1f, 0f), new Vector3(2f, 1000f, 0f));
			this.m_CurveEditor.SetShownHRangeInsideMargins(0f, 2f);
			this.m_CurveEditor.hTicks.SetTickModulosForFrameRate(this.state.frameRate);
			this.InitAllViews();
			this.InitSelection();
		}
Exemplo n.º 38
0
 private void SetupSplitter()
 {
     if ((this.m_Splitter == null) || (this.m_SplitterMinWidths == null))
     {
         this.m_SplitterRelativeSizes = new float[this.m_ColumnNames.Length + 1];
         this.m_SplitterMinWidths = new int[this.m_ColumnNames.Length + 1];
         for (int i = 0; i < this.m_ColumnNames.Length; i++)
         {
             this.m_SplitterMinWidths[i] = (int) styles.header.CalcSize(this.m_HeaderContent[i]).x;
             this.m_SplitterRelativeSizes[i] = 70f;
             if (this.m_HeaderContent[i].image != null)
             {
                 this.m_SplitterRelativeSizes[i] = 1f;
             }
         }
         this.m_SplitterMinWidths[this.m_ColumnNames.Length] = 0x10;
         this.m_SplitterRelativeSizes[this.m_ColumnNames.Length] = 0f;
         if (this.m_ColumnsToShow[0] == ProfilerColumn.FunctionName)
         {
             this.m_SplitterRelativeSizes[0] = 400f;
             this.m_SplitterMinWidths[0] = 100;
         }
         this.m_Splitter = new SplitterState(this.m_SplitterRelativeSizes, this.m_SplitterMinWidths, null);
         string str = EditorPrefs.GetString(this.m_ColumnSettingsName);
         for (int j = 0; j < this.m_ColumnNames.Length; j++)
         {
             if ((j < str.Length) && (str[j] == '0'))
             {
                 this.SetColumnVisible(j, false);
             }
         }
     }
 }
		private void SetupSplitter()
		{
			if (this.m_Splitter != null && this.m_SplitterMinWidths != null)
			{
				return;
			}
			this.m_SplitterRelativeSizes = new float[this.m_ColumnNames.Length + 1];
			this.m_SplitterMinWidths = new int[this.m_ColumnNames.Length + 1];
			for (int i = 0; i < this.m_ColumnNames.Length; i++)
			{
				this.m_SplitterMinWidths[i] = (int)ProfilerHierarchyGUI.styles.header.CalcSize(this.m_HeaderContent[i]).x;
				this.m_SplitterRelativeSizes[i] = 70f;
				if (this.m_HeaderContent[i].image != null)
				{
					this.m_SplitterRelativeSizes[i] = 1f;
				}
			}
			this.m_SplitterMinWidths[this.m_ColumnNames.Length] = 16;
			this.m_SplitterRelativeSizes[this.m_ColumnNames.Length] = 0f;
			if (this.m_ColumnsToShow[0] == ProfilerColumn.FunctionName)
			{
				this.m_SplitterRelativeSizes[0] = 400f;
				this.m_SplitterMinWidths[0] = 100;
			}
			this.m_Splitter = new SplitterState(this.m_SplitterRelativeSizes, this.m_SplitterMinWidths, null);
			string @string = EditorPrefs.GetString(this.m_ColumnSettingsName);
			for (int j = 0; j < this.m_ColumnNames.Length; j++)
			{
				if (j < @string.Length && @string[j] == '0')
				{
					this.SetColumnVisible(j, false);
				}
			}
		}
Exemplo n.º 40
0
 public void DisplayedItemsChanged()
 {
     float[] relativeSizes = new float[2];
     bool flag = (this.sharedChangesets != null) && (this.sharedChangesets.Length != 0);
     bool flag2 = this.pv.lv.totalRows != 0;
     if ((flag && flag2) || (!flag && !flag2))
     {
         relativeSizes[0] = relativeSizes[1] = 0.5f;
     }
     else
     {
         relativeSizes[0] = !flag ? ((float) 0) : ((float) 1);
         relativeSizes[1] = !flag2 ? ((float) 0) : ((float) 1);
     }
     int[] minSizes = new int[] { 80, 80 };
     this.splitter = new SplitterState(relativeSizes, minSizes, null);
     this.DoSelectionChange();
 }
Exemplo n.º 41
0
        public bool PerformDrop(EditorWindow w, DropInfo di, Vector2 screenPos)
        {
            int      num      = (int)di.userData;
            DockArea dockArea = ScriptableObject.CreateInstance <DockArea>();
            Rect     rect     = di.rect;

            if (num == -1 || num == -2 || num == -3)
            {
                bool flag  = num == -2;
                bool flag2 = num == -1;
                this.splitState = null;
                if (this.vertical == flag2 || base.children.Length < 2)
                {
                    this.vertical = flag2;
                    rect.x       -= base.screenPosition.x;
                    rect.y       -= base.screenPosition.y;
                    this.MakeRoomForRect(rect);
                    this.AddChild(dockArea, (!flag) ? base.children.Length : 0);
                    dockArea.position = rect;
                }
                else
                {
                    SplitView splitView = ScriptableObject.CreateInstance <SplitView>();
                    Rect      position  = base.position;
                    splitView.vertical = flag2;
                    splitView.position = new Rect(position.x, position.y, position.width, position.height);
                    if (base.window.mainView == this)
                    {
                        base.window.mainView = splitView;
                    }
                    else
                    {
                        base.parent.AddChild(splitView, base.parent.IndexOfChild(this));
                    }
                    splitView.AddChild(this);
                    base.position = new Rect(0f, 0f, position.width, position.height);
                    Rect rect2 = rect;
                    rect2.x -= base.screenPosition.x;
                    rect2.y -= base.screenPosition.y;
                    splitView.MakeRoomForRect(rect2);
                    dockArea.position = rect2;
                    splitView.AddChild(dockArea, (!flag) ? 1 : 0);
                }
            }
            else if (num < 1000)
            {
                Rect rect3 = rect;
                rect3.x -= base.screenPosition.x;
                rect3.y -= base.screenPosition.y;
                this.MakeRoomForRect(rect3);
                this.AddChild(dockArea, num);
                dockArea.position = rect3;
            }
            else
            {
                int num2 = num % 1000;
                if (base.children.Length != 1)
                {
                    SplitView splitView2 = ScriptableObject.CreateInstance <SplitView>();
                    splitView2.vertical = !this.vertical;
                    Rect position2 = base.children[num2].position;
                    splitView2.AddChild(base.children[num2]);
                    this.AddChild(splitView2, num2);
                    splitView2.position = position2;
                    float num3 = 0f;
                    position2.y = num3;
                    position2.x = num3;
                    splitView2.children[0].position = position2;
                    Rect rect4 = rect;
                    rect4.x -= splitView2.screenPosition.x;
                    rect4.y -= splitView2.screenPosition.y;
                    splitView2.MakeRoomForRect(rect4);
                    splitView2.AddChild(dockArea, (num >= 2000) ? 1 : 0);
                    dockArea.position = rect4;
                }
                else
                {
                    this.vertical = !this.vertical;
                    Rect rect5 = rect;
                    rect5.x -= base.screenPosition.x;
                    rect5.y -= base.screenPosition.y;
                    this.MakeRoomForRect(rect5);
                    this.AddChild(dockArea, (num != 1000) ? 1 : 0);
                    dockArea.position = rect5;
                }
            }
            DockArea.s_OriginalDragSource.RemoveTab(w);
            w.m_Parent = dockArea;
            dockArea.AddTab(w);
            this.Reflow();
            SplitView.RecalcMinMaxAndReflowAll(this);
            dockArea.MakeVistaDWMHappyDance();
            return(true);
        }
Exemplo n.º 42
0
        void Initialize()
        {
            // When reinitializing (e.g. because Colorblind mode or PlatformModule changed) we don't need a new state
            if (m_AttachProfilerState == null)
            {
                m_AttachProfilerState = ConnectionUtility.GetAttachToPlayerState(this, OnTargetedEditorConnectionChanged, IsEditorConnectionTargeted, (player) => ClearFramesCallback());  //new ProfilerAttachToPlayerState(this, (player) => ClearFramesCallback());
            }
            int historySize = ProfilerUserSettings.frameCount;

            m_Charts = new ProfilerChart[Profiler.areaCount];

            Color[] chartAreaColors = ProfilerColors.chartAreaColors;

            for (int i = 0; i < Profiler.areaCount; i++)
            {
                float           scale           = 1.0f;
                Chart.ChartType chartType       = Chart.ChartType.Line;
                string[]        statisticsNames = ProfilerDriver.GetGraphStatisticsPropertiesForArea((ProfilerArea)i);
                int             length          = statisticsNames.Length;
                if (Array.IndexOf(ms_StackedAreas, (ProfilerArea)i) != -1)
                {
                    chartType = Chart.ChartType.StackedFill;
                    scale     = 1.0f / 1000.0f;
                }

                ProfilerChart chart = CreateProfilerChart((ProfilerArea)i, chartType, scale, length);

                if (chart.m_Area == ProfilerArea.CPU)
                {
                    chart.SetOnSeriesToggleCallback(OnToggleCPUChartSeries);
                }

                for (int s = 0; s < length; s++)
                {
                    chart.m_Series[s] = new ChartSeriesViewData(statisticsNames[s], historySize, chartAreaColors[s % chartAreaColors.Length]);
                    for (int frameIdx = 0; frameIdx < historySize; ++frameIdx)
                    {
                        chart.m_Series[s].xValues[frameIdx] = (float)frameIdx;
                    }
                }

                m_Charts[(int)i] = chart;
            }

            if (m_VertSplit == null || m_VertSplit.relativeSizes == null || m_VertSplit.relativeSizes.Length == 0)
            {
                m_VertSplit = new SplitterState(new[] { 50f, 50f }, new[] { k_VertSplitterMinSizes, k_VertSplitterMinSizes }, null);
            }
            // 2 times the min splitter size plus one line height for the toolbar up top
            minSize = new Vector2(Chart.kSideWidth + k_RightPaneMinSize, k_VertSplitterMinSizes * m_VertSplit.minSizes.Length + k_LineHeight);

            // TODO: only create modules for active charts and otherwise lazy initialize them.
            if (m_ProfilerModules == null)
            {
                m_ProfilerModules = new ProfilerModuleBase[]
                {
                    new CPUProfilerModule(),                  //CPU
                    new GPUProfilerModule(),                  //GPU
                    new RenderingProfilerModule(),            //Rendering
                    new MemoryProfilerModule(),               //Memory
                    new AudioProfilerModule(),                //Audio
                    new VideoProfilerModule(),                //Video
                    new PhysicsProfilerModule(),              //Physics
                    new Physics2DProfilerModule(),            //Physics2D
                    new NetworkingMessagesProfilerModule(),   //NetworkMessages
                    new NetworkingOperationsProfilerModule(), //NetworkOperations
                    new UIProfilerModule(),                   //UI
                    new UIDetailsProfilerModule(),            //UIDetails
                    new GlobalIlluminationProfilerModule(),   //GlobalIllumination
                };
            }

            foreach (var module in m_ProfilerModules)
            {
                module?.OnEnable(this);
            }

            UpdateCharts();
            foreach (var chart in m_Charts)
            {
                chart.LoadAndBindSettings();
            }

            m_Initialized = true;
        }
Exemplo n.º 43
0
 // Called once during initialization of m_State
 private void InitializeHorizontalSplitter()
 {
     m_HorizontalSplitter = new SplitterState(new float[] { kHierarchyMinWidth, kHierarchyMinWidth * 3 }, new int[] { kHierarchyMinWidth, kHierarchyMinWidth }, null);
     m_HorizontalSplitter.realSizes[0] = kHierarchyMinWidth;
     m_HorizontalSplitter.realSizes[1] = kHierarchyMinWidth;
 }
Exemplo n.º 44
0
 public SplitterState(float[] relativeSizes, int[] minSizes, int[] maxSizes)
 {
     state = new UnityEditor.SplitterState(relativeSizes, minSizes, maxSizes);
 }
Exemplo n.º 45
0
        public static void BeginSplit(SplitterState state, GUIStyle style, bool vertical, params GUILayoutOption[] options)
        {
            SplitterGUILayout.GUISplitterGroup gUISplitterGroup = (SplitterGUILayout.GUISplitterGroup)GUILayoutUtility.BeginLayoutGroup(style, null, typeof(SplitterGUILayout.GUISplitterGroup));
            state.ID = GUIUtility.GetControlID(SplitterGUILayout.splitterHash, FocusType.Passive);
            switch (Event.current.GetTypeForControl(state.ID))
            {
            case EventType.MouseDown:
                if (Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    int num  = (!gUISplitterGroup.isVertical) ? ((int)gUISplitterGroup.rect.x) : ((int)gUISplitterGroup.rect.y);
                    int num2 = (!gUISplitterGroup.isVertical) ? ((int)Event.current.mousePosition.x) : ((int)Event.current.mousePosition.y);
                    for (int i = 0; i < state.relativeSizes.Length - 1; i++)
                    {
                        if (((!gUISplitterGroup.isVertical) ? new Rect(state.xOffset + (float)num + (float)state.realSizes[i] - (float)(state.splitSize / 2), gUISplitterGroup.rect.y, (float)state.splitSize, gUISplitterGroup.rect.height) : new Rect(state.xOffset + gUISplitterGroup.rect.x, (float)(num + state.realSizes[i] - state.splitSize / 2), gUISplitterGroup.rect.width, (float)state.splitSize)).Contains(Event.current.mousePosition))
                        {
                            state.splitterInitialOffset = num2;
                            state.currentActiveSplitter = i;
                            GUIUtility.hotControl       = state.ID;
                            Event.current.Use();
                            break;
                        }
                        num += state.realSizes[i];
                    }
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == state.ID)
                {
                    GUIUtility.hotControl       = 0;
                    state.currentActiveSplitter = -1;
                    state.RealToRelativeSizes();
                    Event.current.Use();
                }
                break;

            case EventType.MouseDrag:
                if (GUIUtility.hotControl == state.ID && state.currentActiveSplitter >= 0)
                {
                    int num2 = (!gUISplitterGroup.isVertical) ? ((int)Event.current.mousePosition.x) : ((int)Event.current.mousePosition.y);
                    int num3 = num2 - state.splitterInitialOffset;
                    if (num3 != 0)
                    {
                        state.splitterInitialOffset = num2;
                        state.DoSplitter(state.currentActiveSplitter, state.currentActiveSplitter + 1, num3);
                    }
                    Event.current.Use();
                }
                break;

            case EventType.Repaint:
            {
                int num4 = (!gUISplitterGroup.isVertical) ? ((int)gUISplitterGroup.rect.x) : ((int)gUISplitterGroup.rect.y);
                for (int j = 0; j < state.relativeSizes.Length - 1; j++)
                {
                    Rect position = (!gUISplitterGroup.isVertical) ? new Rect(state.xOffset + (float)num4 + (float)state.realSizes[j] - (float)(state.splitSize / 2), gUISplitterGroup.rect.y, (float)state.splitSize, gUISplitterGroup.rect.height) : new Rect(state.xOffset + gUISplitterGroup.rect.x, (float)(num4 + state.realSizes[j] - state.splitSize / 2), gUISplitterGroup.rect.width, (float)state.splitSize);
                    EditorGUIUtility.AddCursorRect(position, (!gUISplitterGroup.isVertical) ? MouseCursor.SplitResizeLeftRight : MouseCursor.ResizeVertical, state.ID);
                    num4 += state.realSizes[j];
                }
                break;
            }

            case EventType.Layout:
                gUISplitterGroup.state       = state;
                gUISplitterGroup.resetCoords = false;
                gUISplitterGroup.isVertical  = vertical;
                gUISplitterGroup.ApplyOptions(options);
                break;
            }
        }
Exemplo n.º 46
0
        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));
        }
Exemplo n.º 47
0
 private void DrawDetailedMemoryPane(SplitterState splitter)
 {
     SplitterGUILayout.BeginHorizontalSplit(splitter, new GUILayoutOption[0]);
     this.m_MemoryListView.OnGUI();
     this.m_ReferenceListView.OnGUI();
     SplitterGUILayout.EndHorizontalSplit();
 }
 public static void BeginHorizontalSplit(SplitterState state, GUIStyle style, params GUILayoutOption[] options)
 {
   SplitterGUILayout.BeginSplit(state, style, false, options);
 }
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            float[] relativeSizes = new float[] { 20f, 80f };
            int[]   minSizes      = new int[] { 100, 100 };
            this.lvHeaderSplit1 = new SplitterState(relativeSizes, minSizes, null);
            float[] singleArray2 = new float[] { 20f, 80f };
            int[]   numArray2    = new int[] { 100, 100 };
            this.lvHeaderSplit2             = new SplitterState(singleArray2, numArray2, null);
            this.dropDownMenuItems          = new string[] { "Compare", "Compare Binary" };
            this.downloadConflicts          = new string[0];
            this.nameConflicts              = new string[0];
            this.dConflictPaths             = new string[0];
            this.dNamingPaths               = new string[0];
            this.downloadResolutions        = new DownloadResolution[0];
            this.namingResolutions          = new NameConflictResolution[0];
            this.downloadConflictsToResolve = 0;
            this.mySelection                = false;
            this.enableContinueButton       = false;
            this.enableMergeButton          = true;
            this.splittersOk                = false;
            this.iconSize                   = new Vector2(16f, 16f);
            this.constants                  = null;
            this.downloadResolutionString   = new string[] { "Unresolved", "Skip Asset", "Discard My Changes", "Ignore Server Changes", "Merge" };
            this.namingResolutionString     = new string[] { "Unresolved", "Rename Local Asset", "Rename Server Asset" };
            this.downloadConflictsToResolve = 0;
            ArrayList list  = new ArrayList();
            ArrayList list2 = new ArrayList();
            ArrayList list3 = new ArrayList();
            ArrayList list4 = new ArrayList();

            for (int i = 0; i < conflicting.Length; i++)
            {
                AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
                if (statusGUID == AssetStatus.Conflict)
                {
                    list.Add(conflicting[i]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
                    list2.Add(downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
                if ((AssetServer.GetPathNameConflict(conflicting[i]) != null) && (statusGUID != AssetStatus.ServerOnly))
                {
                    list4.Add(conflicting[i]);
                    NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
                    list3.Add(nameConflictResolution);
                    if (nameConflictResolution == NameConflictResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
            }
            this.downloadConflicts    = list.ToArray(typeof(string)) as string[];
            this.downloadResolutions  = list2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
            this.namingResolutions    = list3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
            this.nameConflicts        = list4.ToArray(typeof(string)) as string[];
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int j = 0; j < this.downloadConflicts.Length; j++)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = true;
                }
                else
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int k = 0; k < this.nameConflicts.Length; k++)
            {
                this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
            }
            this.showDownloadConflicts = this.downloadConflicts.Length > 0;
            this.showNamingConflicts   = this.nameConflicts.Length > 0;
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }
Exemplo n.º 50
0
 public override void RemoveChild(View child)
 {
     this.splitState = null;
     base.RemoveChild(child);
 }