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