当前位置: 首页>>代码示例>>C#>>正文


C# IReorderableListAdaptor.EndGUI方法代码示例

本文整理汇总了C#中IReorderableListAdaptor.EndGUI方法的典型用法代码示例。如果您正苦于以下问题:C# IReorderableListAdaptor.EndGUI方法的具体用法?C# IReorderableListAdaptor.EndGUI怎么用?C# IReorderableListAdaptor.EndGUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IReorderableListAdaptor的用法示例。


在下文中一共展示了IReorderableListAdaptor.EndGUI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawLayoutEmptyList

		/// <summary>
		/// Draw content for empty list (layout version).
		/// </summary>
		/// <param name="adaptor">Reorderable list adaptor.</param>
		/// <param name="drawEmpty">Callback to draw empty content.</param>
		/// <returns>
		/// Position of list container area in GUI (excludes footer area).
		/// </returns>
		private Rect DrawLayoutEmptyList(IReorderableListAdaptor adaptor, DrawEmpty drawEmpty) {
			Rect position = EditorGUILayout.BeginVertical(ContainerStyle);
			{
				if (drawEmpty != null)
					drawEmpty();
				else
					Debug.LogError("Unexpected call to 'DrawLayoutEmptyList'");

				s_CurrentListStack.Push(new ListInfo(_controlID, position));
				try {
					adaptor.BeginGUI();
					_insertionIndex = 0;
					_insertionPosition = position.y + 2;
					HandleDropInsertion(position, adaptor);
					adaptor.EndGUI();
				}
				finally {
					s_CurrentListStack.Pop();
				}
			}
			EditorGUILayout.EndVertical();

			// Allow room for footer buttons?
			if (HasFooterButtons)
				GUILayoutUtility.GetRect(0, FooterButtonStyle.fixedHeight - 1);

			return position;
		}
开发者ID:zorbathut,项目名称:gt_byg,代码行数:36,代码来源:ReorderableListControl.cs

示例2: Draw

		/// <summary>
		/// Draw list control with absolute positioning.
		/// </summary>
		/// <param name="position">Position of list control in GUI.</param>
		/// <param name="controlID">Unique ID of list control.</param>
		/// <param name="adaptor">Reorderable list adaptor.</param>
		/// <param name="drawEmpty">Delegate for drawing empty list.</param>
		private void Draw(Rect position, int controlID, IReorderableListAdaptor adaptor, DrawEmptyAbsolute drawEmpty) {
			FixStyles();
			PrepareState(controlID, adaptor);

			// Allow for footer area.
			if (HasFooterButtons)
				position.height -= FooterButtonStyle.fixedHeight;

			s_CurrentListStack.Push(new ListInfo(_controlID, position));
			try {
				adaptor.BeginGUI();

				DrawListContainerAndItems(position, adaptor);
				HandleDropInsertion(position, adaptor);
				CheckForAutoFocusControl();

				if (adaptor.Count == 0) {
					ReorderableListGUI.IndexOfChangedItem = -1;
					DrawEmptyListControl(position, drawEmpty);
				}

				adaptor.EndGUI();
			}
			finally {
				s_CurrentListStack.Pop();
			}

			DrawFooterControls(position, adaptor);
		}
开发者ID:zorbathut,项目名称:gt_byg,代码行数:36,代码来源:ReorderableListControl.cs

示例3: DrawLayoutListField

		/// <summary>
		/// Do layout version of list field.
		/// </summary>
		/// <param name="adaptor">Reorderable list adaptor.</param>
		/// <param name="padding">Padding in pixels.</param>
		/// <returns>
		/// Position of list container area in GUI (excludes footer area).
		/// </returns>
		private Rect DrawLayoutListField(IReorderableListAdaptor adaptor, float padding) {
			Rect position = GetListRectWithAutoLayout(adaptor, padding);

			// Make room for footer buttons?
			if (HasFooterButtons)
				position.height -= FooterButtonStyle.fixedHeight;

			s_CurrentListStack.Push(new ListInfo(_controlID, position));
			try {
				// Draw list as normal.
				adaptor.BeginGUI();
				DrawListContainerAndItems(position, adaptor);
				HandleDropInsertion(position, adaptor);
				adaptor.EndGUI();
			}
			finally {
				s_CurrentListStack.Pop();
            }

			CheckForAutoFocusControl();

			return position;
		}
开发者ID:zorbathut,项目名称:gt_byg,代码行数:31,代码来源:ReorderableListControl.cs


注:本文中的IReorderableListAdaptor.EndGUI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。