我的问题是当我从列表中删除列表中的画图功能时。意外的文件处理错误从列表<>中删除并出现画笔错误
List<monster> Monster = new List<monster>();
//Initilize
Monster.add(new Monster());
//Update
if (Monster[0]. health == 0)
{
Monster.removeAt[0];
}
//Draw
If (Monster[0].health > 0)
{
spriteBatch.Draw(Monster[0].texutre,Monster[0].pos,Color.White);
}
有没有办法只绘制取决于是否有一个列表<>里面的怪物?