本文整理汇总了C#中BetterList.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# BetterList.Contains方法的具体用法?C# BetterList.Contains怎么用?C# BetterList.Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BetterList
的用法示例。
在下文中一共展示了BetterList.Contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
//.........这里部分代码省略.........
mMouseIsInside = false;
currentEvent.Use();
}
else if (type == EventType.DragExited || type == EventType.Ignore)
{
mMouseIsInside = false;
}
// If the mouse is not inside the window, clear the selection and dragged object
if (!mMouseIsInside)
{
selection = null;
dragged = null;
}
// Create a list of indices, inserting an entry of '-1' underneath the dragged object
BetterList<int> indices = new BetterList<int>();
for (int i = 0; i < mItems.size; )
{
if (dragged != null && indices.size == indexUnderMouse)
indices.Add(-1);
if (mItems[i] != selection)
{
if (string.IsNullOrEmpty(searchFilter) ||
mItems[i].prefab.name.IndexOf(searchFilter, System.StringComparison.CurrentCultureIgnoreCase) != -1)
indices.Add(i);
}
++i;
}
// There must always be '-1' (Add/Move slot) present
if (!indices.Contains(-1)) indices.Add(-1);
// We want to start dragging something from within the window
if (eligibleToDrag && type == EventType.MouseDown && indexUnderMouse > -1)
{
GUIUtility.keyboardControl = 0;
if (currentEvent.button == 0 && indexUnderMouse < indices.size)
{
int index = indices[indexUnderMouse];
if (index != -1 && index < mItems.size)
{
selection = mItems[index];
draggedObject = selection.prefab;
dragged = selection.prefab;
currentEvent.Use();
}
}
}
//else if (type == EventType.MouseUp && currentEvent.button == 1 && indexUnderMouse > mItems.size)
//{
// NGUIContextMenu.AddItem("Reset", false, RemoveItem, index);
// NGUIContextMenu.Show();
//}
// Draw the scroll view with prefabs
mPos = GUILayout.BeginScrollView(mPos);
{
Color normal = new Color(1f, 1f, 1f, 0.5f);
for (int i = 0; i < indices.size; ++i)
{