public Vector2 ScrollList(Vector2 listInfo, bool vertical, List indexList,
Action renderFunc, GUILayoutOption[] svLp, GUILayoutOption[] containerLp)
{
if (indexList.Count == 0)
{
GUILayout.Label(“dataList is empty!”);
return listInfo;
}
//列表
listInfo = GUILayout.BeginScrollView(listInfo, svLp);
for (int i = 0; i < indexList.Count; i++)
{
renderFunc(indexList[i]);
}
GUILayout.EndScrollView();
return listInfo;
}
public void RenderItem(int index)
{
}
private void OnGUI()
{
EditorGUILayout.LabelField(" ");
listInfo = ScrollList<int>(listInfo, true, new List<int>(cellDics.Keys) , RenderItem,
new GUILayoutOption[] { },
new GUILayoutOption[] { });
EditorGUILayout.LabelField(" ");
}