我正在遍历主列表中的所有列表,如果出现特定情况.我想删除该特定列表.
它不起作用.
for (int i = 0; i < mainList.Count; i++)
{
if (mainList[i].Dead == true) //
{
mainList.removeAt(i);//what will be affect on mainList.Count;
}
}
Run Code Online (Sandbox Code Playgroud)