Remove and Add to List By Name aad

Hello Everyone

i have a 2 List

#1 Called : freeSpawnPoints
#2 Called : TheNewSpawnPoints

both of them Contain Transforms

now… i want to Add Something from List1 to List2 by using the name of transform

for Example

i have List1 Transform Called “T1”

i want to move “T1” Transform from List1 to List2

Here is my Idea Code :

	freeSpawnPoints.Add(TheNewSpawnPoints.Find("T1"));


//AND i need Same way to remove it from the List

TheNewSpawnPoints.Remove("T1");

i hope u got my poing… and thanks

Try this:

TheNewSpawnPoints.RemoveAll(x=>x.name=="T1");

Alternatively, this should work as well:

var t1 = TheNewSpawnPoints.Find("T1");
freeSpawnPoints.Add(t1);
TheNewSpawnPoints.Remove(t1);