コード例 #1
0
		private void TableGUI(Rect rect)
		{
			int num = 6;
			int num2 = 31 + num * 2;
			int num3 = 0;
			int[] array = new int[]
			{
				15,
				30,
				30,
				30,
				45,
				45
			};
			Color color = GUI.color;
			int num4 = 62;
			GUI.color = LayoutDropdownWindow.s_Styles.tableHeaderColor * color;
			GUI.DrawTexture(new Rect(0f, 0f, 400f, (float)num4), EditorGUIUtility.whiteTexture);
			GUI.DrawTexture(new Rect(0f, 0f, (float)num4, 400f), EditorGUIUtility.whiteTexture);
			GUI.color = LayoutDropdownWindow.s_Styles.tableLineColor * color;
			GUI.DrawTexture(new Rect(0f, (float)num4, 400f, 1f), EditorGUIUtility.whiteTexture);
			GUI.DrawTexture(new Rect((float)num4, 0f, 1f, 400f), EditorGUIUtility.whiteTexture);
			GUI.color = color;
			LayoutDropdownWindow.LayoutMode layoutModeForAxis = LayoutDropdownWindow.GetLayoutModeForAxis(this.m_AnchorMin, this.m_AnchorMax, this.m_Position, this.m_SizeDelta, 0);
			LayoutDropdownWindow.LayoutMode layoutMode = LayoutDropdownWindow.GetLayoutModeForAxis(this.m_AnchorMin, this.m_AnchorMax, this.m_Position, this.m_SizeDelta, 1);
			layoutMode = LayoutDropdownWindow.SwappedVMode(layoutMode);
			bool shift = Event.current.shift;
			bool alt = Event.current.alt;
			int num5 = 5;
			for (int i = 0; i < num5; i++)
			{
				LayoutDropdownWindow.LayoutMode layoutMode2 = (LayoutDropdownWindow.LayoutMode)(i - 1);
				for (int j = 0; j < num5; j++)
				{
					LayoutDropdownWindow.LayoutMode layoutMode3 = (LayoutDropdownWindow.LayoutMode)(j - 1);
					if (i != 0 || j != 0 || layoutMode < LayoutDropdownWindow.LayoutMode.Min || layoutModeForAxis < LayoutDropdownWindow.LayoutMode.Min)
					{
						Rect position = new Rect((float)(i * (num2 + num3) + array[i]), (float)(j * (num2 + num3) + array[j]), (float)num2, (float)num2);
						if (j == 0 && (i != 0 || layoutModeForAxis == LayoutDropdownWindow.LayoutMode.Undefined))
						{
							LayoutDropdownWindow.DrawLayoutModeHeaderOutsideRect(position, 0, layoutMode2);
						}
						if (i == 0 && (j != 0 || layoutMode == LayoutDropdownWindow.LayoutMode.Undefined))
						{
							LayoutDropdownWindow.DrawLayoutModeHeaderOutsideRect(position, 1, layoutMode3);
						}
						bool flag = layoutMode2 == layoutModeForAxis && layoutMode3 == layoutMode;
						bool flag2 = false;
						if (i == 0 && layoutMode3 == layoutMode)
						{
							flag2 = true;
						}
						if (j == 0 && layoutMode2 == layoutModeForAxis)
						{
							flag2 = true;
						}
						if (Event.current.type == EventType.Repaint)
						{
							if (flag)
							{
								GUI.color = Color.white * color;
								LayoutDropdownWindow.s_Styles.frame.Draw(position, false, false, false, false);
							}
							else if (flag2)
							{
								GUI.color = new Color(1f, 1f, 1f, 0.7f) * color;
								LayoutDropdownWindow.s_Styles.frame.Draw(position, false, false, false, false);
							}
						}
						LayoutDropdownWindow.DrawLayoutMode(new Rect(position.x + (float)num, position.y + (float)num, position.width - (float)(num * 2), position.height - (float)(num * 2)), layoutMode2, layoutMode3, shift, alt);
						int clickCount = Event.current.clickCount;
						if (GUI.Button(position, GUIContent.none, GUIStyle.none))
						{
							LayoutDropdownWindow.SetLayoutModeForAxis(this.m_AnchorMin, this.m_AnchorMax, this.m_Position, this.m_SizeDelta, this.m_Pivot, 0, layoutMode2, shift, alt, this.m_InitValues);
							LayoutDropdownWindow.SetLayoutModeForAxis(this.m_AnchorMin, this.m_AnchorMax, this.m_Position, this.m_SizeDelta, this.m_Pivot, 1, LayoutDropdownWindow.SwappedVMode(layoutMode3), shift, alt, this.m_InitValues);
							if (clickCount == 2)
							{
								base.editorWindow.Close();
							}
							else
							{
								base.editorWindow.Repaint();
							}
						}
					}
				}
			}
			GUI.color = color;
		}
コード例 #2
0
 private static void SetLayoutModeForAxis(SerializedProperty anchorMin, SerializedProperty anchorMax, SerializedProperty position, SerializedProperty sizeDelta, SerializedProperty pivot, int axis, LayoutDropdownWindow.LayoutMode layoutMode, bool doPivot, bool doPosition)
 {
     LayoutDropdownWindow.SetLayoutModeForAxis(anchorMin, anchorMax, position, sizeDelta, pivot, axis, layoutMode, doPivot, doPosition, null);
 }