If I add items to a list from a variable value, then change the variable, it changes all of added items too. Everything in the list is still tied to the added variable. How can I make each list item unique/seperate?
Here is an example called “MyClass”:
public string name;
public List<GameObject> gos;
Then I have a script with:
public MyClass selected;
public List<MyClass> saved;
When I add selected to the saved list, it adds, but when I change selected’s Name value, it changes all of them in the list.