Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created October 10, 2012 08:29
Show Gist options
  • Select an option

  • Save AngryAnt/3864056 to your computer and use it in GitHub Desktop.

Select an option

Save AngryAnt/3864056 to your computer and use it in GitHub Desktop.
Example showing how to remove an item in a list inside a loop using that list.
for (int i = 0; i < list.Count;)
{
GUILayout.Label (list[i].ToString ());
if (GUILayout.Button ("Delete"))
{
list.RemoveAt (i);
}
else
{
i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment