예제 #1
0
            public void Draw(ProfilerHierarchyGUI gui, int controlID)
            {
                int num;
                int num2;

                this.HandleCommandEvents(gui);
                Event  current = Event.current;
                string selectedPropertyPath = ProfilerDriver.selectedPropertyPath;

                GetFirstAndLastRowVisible(this.m_NumResultsUsed, 16f, gui.m_TextScroll.y, (float)gui.m_ScrollViewHeight, out num, out num2);
                for (int i = num; i <= num2; i++)
                {
                    bool     on                 = selectedPropertyPath == this.m_SearchResults[i].propertyPath;
                    Rect     rowRect            = gui.GetRowRect(i);
                    GUIStyle rowBackgroundStyle = gui.GetRowBackgroundStyle(i);
                    if ((current.type == EventType.MouseDown) && rowRect.Contains(current.mousePosition))
                    {
                        this.m_SelectedSearchIndex = i;
                        gui.RowMouseDown(this.m_SearchResults[i].propertyPath);
                        GUIUtility.keyboardControl = controlID;
                        current.Use();
                    }
                    if (current.type == EventType.Repaint)
                    {
                        rowBackgroundStyle.Draw(rowRect, GUIContent.none, false, false, on, GUIUtility.keyboardControl == controlID);
                        if (rowRect.Contains(current.mousePosition))
                        {
                            string tooltip = this.m_SearchResults[i].propertyPath.Replace("/", "/\n");
                            if (this.m_SelectedSearchIndex >= 0)
                            {
                                tooltip = tooltip + "\n\n(Press 'F' to frame selection)";
                            }
                            GUI.Label(rowRect, GUIContent.Temp(string.Empty, tooltip));
                        }
                        gui.DrawTextColumn(ref rowRect, this.m_SearchResults[i].columnValues[0], 0, 4f, on);
                        ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleRight;
                        int index = 1;
                        for (int j = 1; j < gui.m_VisibleColumns.Length; j++)
                        {
                            if (gui.ColIsVisible(j))
                            {
                                rowRect.x    += gui.m_Splitter.realSizes[index - 1];
                                rowRect.width = gui.m_Splitter.realSizes[index] - 4f;
                                index++;
                                ProfilerHierarchyGUI.styles.numberLabel.Draw(rowRect, this.m_SearchResults[i].columnValues[j], false, false, false, on);
                            }
                        }
                        ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleLeft;
                    }
                }
                if (!this.m_FoundAllResults && (current.type == EventType.Repaint))
                {
                    int      numResultsUsed = this.m_NumResultsUsed;
                    Rect     position       = new Rect(1f, 16f * numResultsUsed, GUIClip.visibleRect.width, 16f);
                    GUIStyle style2         = ((numResultsUsed % 2) != 0) ? ProfilerHierarchyGUI.styles.entryOdd : ProfilerHierarchyGUI.styles.entryEven;
                    GUI.Label(position, GUIContent.Temp(string.Empty, ProfilerHierarchyGUI.styles.notShowingAllResults.tooltip), GUIStyle.none);
                    style2.Draw(position, GUIContent.none, false, false, false, false);
                    gui.DrawTextColumn(ref position, ProfilerHierarchyGUI.styles.notShowingAllResults.text, 0, 4f, false);
                }
            }
			public void Draw(ProfilerHierarchyGUI gui, int controlID)
			{
				this.HandleCommandEvents(gui);
				Event current = Event.current;
				string selectedPropertyPath = ProfilerDriver.selectedPropertyPath;
				int num;
				int num2;
				ProfilerHierarchyGUI.SearchResults.GetFirstAndLastRowVisible(this.m_NumResultsUsed, 16f, gui.m_TextScroll.y, (float)gui.m_ScrollViewHeight, out num, out num2);
				for (int i = num; i <= num2; i++)
				{
					bool flag = selectedPropertyPath == this.m_SearchResults[i].propertyPath;
					Rect rowRect = gui.GetRowRect(i);
					GUIStyle rowBackgroundStyle = gui.GetRowBackgroundStyle(i);
					if (current.type == EventType.MouseDown && rowRect.Contains(current.mousePosition))
					{
						this.m_SelectedSearchIndex = i;
						gui.RowMouseDown(this.m_SearchResults[i].propertyPath);
						GUIUtility.keyboardControl = controlID;
						current.Use();
					}
					if (current.type == EventType.Repaint)
					{
						rowBackgroundStyle.Draw(rowRect, GUIContent.none, false, false, flag, GUIUtility.keyboardControl == controlID);
						if (rowRect.Contains(current.mousePosition))
						{
							string text = this.m_SearchResults[i].propertyPath.Replace("/", "/\n");
							if (this.m_SelectedSearchIndex >= 0)
							{
								text += "\n\n(Press 'F' to frame selection)";
							}
							GUI.Label(rowRect, GUIContent.Temp(string.Empty, text));
						}
						gui.DrawTextColumn(ref rowRect, this.m_SearchResults[i].columnValues[0], 0, 4f, flag);
						ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleRight;
						int num3 = 1;
						for (int j = 1; j < gui.m_VisibleColumns.Length; j++)
						{
							if (gui.ColIsVisible(j))
							{
								rowRect.x += (float)gui.m_Splitter.realSizes[num3 - 1];
								rowRect.width = (float)gui.m_Splitter.realSizes[num3] - 4f;
								num3++;
								ProfilerHierarchyGUI.styles.numberLabel.Draw(rowRect, this.m_SearchResults[i].columnValues[j], false, false, false, flag);
							}
						}
						ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleLeft;
					}
				}
				if (!this.m_FoundAllResults && current.type == EventType.Repaint)
				{
					int numResultsUsed = this.m_NumResultsUsed;
					Rect position = new Rect(1f, 16f * (float)numResultsUsed, GUIClip.visibleRect.width, 16f);
					GUIStyle gUIStyle = (numResultsUsed % 2 != 0) ? ProfilerHierarchyGUI.styles.entryOdd : ProfilerHierarchyGUI.styles.entryEven;
					GUI.Label(position, GUIContent.Temp(string.Empty, ProfilerHierarchyGUI.styles.notShowingAllResults.tooltip), GUIStyle.none);
					gUIStyle.Draw(position, GUIContent.none, false, false, false, false);
					gui.DrawTextColumn(ref position, ProfilerHierarchyGUI.styles.notShowingAllResults.text, 0, 4f, false);
				}
			}
            public void Draw(ProfilerHierarchyGUI gui, int controlID)
            {
                this.HandleCommandEvents(gui);
                Event  current = Event.current;
                string selectedPropertyPath = ProfilerDriver.selectedPropertyPath;
                int    firstRowVisible;
                int    lastRowVisible;

                ProfilerHierarchyGUI.SearchResults.GetFirstAndLastRowVisible(this.m_NumResultsUsed, 16f, gui.m_TextScroll.y, (float)gui.m_ScrollViewHeight, out firstRowVisible, out lastRowVisible);
                for (int rowIndex = firstRowVisible; rowIndex <= lastRowVisible; ++rowIndex)
                {
                    bool     flag               = selectedPropertyPath == this.m_SearchResults[rowIndex].propertyPath;
                    Rect     rowRect            = gui.GetRowRect(rowIndex);
                    GUIStyle rowBackgroundStyle = gui.GetRowBackgroundStyle(rowIndex);
                    if (current.type == EventType.MouseDown && rowRect.Contains(current.mousePosition))
                    {
                        this.m_SelectedSearchIndex = rowIndex;
                        gui.RowMouseDown(this.m_SearchResults[rowIndex].propertyPath);
                        GUIUtility.keyboardControl = controlID;
                        current.Use();
                    }
                    if (current.type == EventType.Repaint)
                    {
                        rowBackgroundStyle.Draw(rowRect, GUIContent.none, false, false, flag, GUIUtility.keyboardControl == controlID);
                        if (rowRect.Contains(current.mousePosition))
                        {
                            string tooltip = this.m_SearchResults[rowIndex].propertyPath.Replace("/", "/\n");
                            if (this.m_SelectedSearchIndex >= 0)
                            {
                                tooltip += "\n\n(Press 'F' to frame selection)";
                            }
                            GUI.Label(rowRect, GUIContent.Temp(string.Empty, tooltip));
                        }
                        gui.DrawTextColumn(ref rowRect, this.m_SearchResults[rowIndex].columnValues[0], 0, 4f, flag);
                        ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleRight;
                        int index1 = 1;
                        for (int index2 = 1; index2 < gui.m_VisibleColumns.Length; ++index2)
                        {
                            if (gui.ColIsVisible(index2))
                            {
                                rowRect.x    += (float)gui.m_Splitter.realSizes[index1 - 1];
                                rowRect.width = (float)gui.m_Splitter.realSizes[index1] - 4f;
                                ++index1;
                                ProfilerHierarchyGUI.styles.numberLabel.Draw(rowRect, this.m_SearchResults[rowIndex].columnValues[index2], false, false, false, flag);
                            }
                        }
                        ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleLeft;
                    }
                }
                if (this.m_FoundAllResults || current.type != EventType.Repaint)
                {
                    return;
                }
                int      numResultsUsed = this.m_NumResultsUsed;
                Rect     currentRect    = new Rect(1f, 16f * (float)numResultsUsed, GUIClip.visibleRect.width, 16f);
                GUIStyle guiStyle       = numResultsUsed % 2 != 0 ? ProfilerHierarchyGUI.styles.entryOdd : ProfilerHierarchyGUI.styles.entryEven;

                GUI.Label(currentRect, GUIContent.Temp(string.Empty, ProfilerHierarchyGUI.styles.notShowingAllResults.tooltip), GUIStyle.none);
                guiStyle.Draw(currentRect, GUIContent.none, false, false, false, false);
                gui.DrawTextColumn(ref currentRect, ProfilerHierarchyGUI.styles.notShowingAllResults.text, 0, 4f, false);
            }
 public void Draw(ProfilerHierarchyGUI gui, int controlID)
 {
   this.HandleCommandEvents(gui);
   Event current = Event.current;
   string selectedPropertyPath = ProfilerDriver.selectedPropertyPath;
   int firstRowVisible;
   int lastRowVisible;
   ProfilerHierarchyGUI.SearchResults.GetFirstAndLastRowVisible(this.m_NumResultsUsed, 16f, gui.m_TextScroll.y, (float) gui.m_ScrollViewHeight, out firstRowVisible, out lastRowVisible);
   for (int rowIndex = firstRowVisible; rowIndex <= lastRowVisible; ++rowIndex)
   {
     bool flag = selectedPropertyPath == this.m_SearchResults[rowIndex].propertyPath;
     Rect rowRect = gui.GetRowRect(rowIndex);
     GUIStyle rowBackgroundStyle = gui.GetRowBackgroundStyle(rowIndex);
     if (current.type == EventType.MouseDown && rowRect.Contains(current.mousePosition))
     {
       this.m_SelectedSearchIndex = rowIndex;
       gui.RowMouseDown(this.m_SearchResults[rowIndex].propertyPath);
       GUIUtility.keyboardControl = controlID;
       current.Use();
     }
     if (current.type == EventType.Repaint)
     {
       rowBackgroundStyle.Draw(rowRect, GUIContent.none, false, false, flag, GUIUtility.keyboardControl == controlID);
       if (rowRect.Contains(current.mousePosition))
       {
         string tooltip = this.m_SearchResults[rowIndex].propertyPath.Replace("/", "/\n");
         if (this.m_SelectedSearchIndex >= 0)
           tooltip += "\n\n(Press 'F' to frame selection)";
         GUI.Label(rowRect, GUIContent.Temp(string.Empty, tooltip));
       }
       gui.DrawTextColumn(ref rowRect, this.m_SearchResults[rowIndex].columnValues[0], 0, 4f, flag);
       ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleRight;
       int index1 = 1;
       for (int index2 = 1; index2 < gui.m_VisibleColumns.Length; ++index2)
       {
         if (gui.ColIsVisible(index2))
         {
           rowRect.x += (float) gui.m_Splitter.realSizes[index1 - 1];
           rowRect.width = (float) gui.m_Splitter.realSizes[index1] - 4f;
           ++index1;
           ProfilerHierarchyGUI.styles.numberLabel.Draw(rowRect, this.m_SearchResults[rowIndex].columnValues[index2], false, false, false, flag);
         }
       }
       ProfilerHierarchyGUI.styles.numberLabel.alignment = TextAnchor.MiddleLeft;
     }
   }
   if (this.m_FoundAllResults || current.type != EventType.Repaint)
     return;
   int numResultsUsed = this.m_NumResultsUsed;
   Rect currentRect = new Rect(1f, 16f * (float) numResultsUsed, GUIClip.visibleRect.width, 16f);
   GUIStyle guiStyle = numResultsUsed % 2 != 0 ? ProfilerHierarchyGUI.styles.entryOdd : ProfilerHierarchyGUI.styles.entryEven;
   GUI.Label(currentRect, GUIContent.Temp(string.Empty, ProfilerHierarchyGUI.styles.notShowingAllResults.tooltip), GUIStyle.none);
   guiStyle.Draw(currentRect, GUIContent.none, false, false, false, false);
   gui.DrawTextColumn(ref currentRect, ProfilerHierarchyGUI.styles.notShowingAllResults.text, 0, 4f, false);
 }