Hi all,
I’m having some difficulties here. I’ve set up a custom list
public class ItemList {
public string itemName;
public int typeID;
public int modification1;
public ItemList(string newName, int newID, int newMod1)
{
itemName = newName;
typeID = newID;
modification1 = newMod1;
}
}
I’m adding items in another script
void Start()
{
items.Add(new ItemList("Tiny Test Bag", 20, 4));
items.Add(new ItemList("Small Test Bag", 20, 8));
items.Add(new ItemList("Medium Test Bag", 20, 16));
items.Add(new ItemList("Large Test Bag", 20, 32));
}
and I’m wanting to remove certain items from that list based on the values rather than index. I’ve looked over the MSDN page on list.remove but the examples don’t work when I convert them to my project.
Any help would be appreciated!
I’d rather avoid using RemoveAll in case there are multiple items that have the same values. It doesn’t really matter which gets removed, so long as it’s not all of them.
I decided to continue this thread rather than create a new thread, since it’s of a similar topic
I’m trying to get my list to sync using the UNet syncing, but I can’t seem to figure it out. Is the list I created considered an abstract? Is there a special way to go about getting custom lists to sync?