本文整理汇总了C#中UnityEditorInternal.ReorderableList.onAddDropdownCallback方法的典型用法代码示例。如果您正苦于以下问题:C# ReorderableList.onAddDropdownCallback方法的具体用法?C# ReorderableList.onAddDropdownCallback怎么用?C# ReorderableList.onAddDropdownCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditorInternal.ReorderableList
的用法示例。
在下文中一共展示了ReorderableList.onAddDropdownCallback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawFooter
public void DrawFooter(Rect rect, ReorderableList list)
{
float xMax = rect.xMax;
float num = xMax - 8f;
if (list.displayAdd)
{
num -= 25f;
}
if (list.displayRemove)
{
num -= 25f;
}
rect = new Rect(num, rect.y, xMax - num, rect.height);
Rect rect2 = new Rect(num + 4f, rect.y - 3f, 25f, 13f);
Rect position = new Rect(xMax - 29f, rect.y - 3f, 25f, 13f);
if (Event.current.type == EventType.Repaint)
{
this.footerBackground.Draw(rect, false, false, false, false);
}
if (list.displayAdd && GUI.Button(rect2, (list.onAddDropdownCallback == null) ? this.iconToolbarPlus : this.iconToolbarPlusMore, this.preButton))
{
if (list.onAddDropdownCallback != null)
{
list.onAddDropdownCallback(rect2, list);
}
else
{
if (list.onAddCallback != null)
{
list.onAddCallback(list);
}
else
{
this.DoAddButton(list);
}
}
if (list.onChangedCallback != null)
{
list.onChangedCallback(list);
}
}
if (list.displayRemove)
{
EditorGUI.BeginDisabledGroup(list.index < 0 || list.index >= list.count || (list.onCanRemoveCallback != null && !list.onCanRemoveCallback(list)));
if (GUI.Button(position, this.iconToolbarMinus, this.preButton))
{
if (list.onRemoveCallback == null)
{
this.DoRemoveButton(list);
}
else
{
list.onRemoveCallback(list);
}
if (list.onChangedCallback != null)
{
list.onChangedCallback(list);
}
}
EditorGUI.EndDisabledGroup();
}
}
示例2: DrawFooter
public void DrawFooter(Rect rect, ReorderableList list)
{
float xMax = rect.xMax;
float x = xMax - 8f;
if (list.displayAdd)
{
x -= 25f;
}
if (list.displayRemove)
{
x -= 25f;
}
rect = new Rect(x, rect.y, xMax - x, rect.height);
Rect position = new Rect(x + 4f, rect.y - 3f, 25f, 13f);
Rect rect3 = new Rect(xMax - 29f, rect.y - 3f, 25f, 13f);
if (Event.current.type == EventType.Repaint)
{
this.footerBackground.Draw(rect, false, false, false, false);
}
if (list.displayAdd && GUI.Button(position, (list.onAddDropdownCallback == null) ? this.iconToolbarPlus : this.iconToolbarPlusMore, this.preButton))
{
if (list.onAddDropdownCallback != null)
{
list.onAddDropdownCallback(position, list);
}
else if (list.onAddCallback != null)
{
list.onAddCallback(list);
}
else
{
this.DoAddButton(list);
}
if (list.onChangedCallback != null)
{
list.onChangedCallback(list);
}
}
if (list.displayRemove)
{
using (new EditorGUI.DisabledScope(((list.index < 0) || (list.index >= list.count)) || ((list.onCanRemoveCallback != null) && !list.onCanRemoveCallback(list))))
{
if (GUI.Button(rect3, this.iconToolbarMinus, this.preButton))
{
if (list.onRemoveCallback == null)
{
this.DoRemoveButton(list);
}
else
{
list.onRemoveCallback(list);
}
if (list.onChangedCallback != null)
{
list.onChangedCallback(list);
}
}
}
}
}