Feeling dumb, but I couldn’t find an answer here or the forums.
I have a list of gameobjects and I want to remove all occurrences of a specific gameobject from that list. I’ve played around using RemoveAll() and ForEach loops, but no luck so far.
To illustrate my request:
List<GameObject> testList = new List<GameObject>();
testList.Add (obj1);
testList.Add (obj1);
testList.Add (obj2);
testList.Add (obj3);
What I would like to be able to do, for example, is to remove all occurrences of obj1 from testList. The testList should then only return obj2 and obj3.