Browsing around google it seems that you can use this:
List<string> result = list1.Except(list2).ToList();
to compare the differences between two lists. So I added my variables in and gave it a try and came up with this:
void OnEnable() {
List<Inventory> result = playerCurrentInventoryList.Except(allInventoryList).ToList();
CompareDifferences();
}
void CompareDifferences() {
foreach (Inventory _item in result)
Debug.Log ("result differences iventory" + _item.Name);
}
No debug.logs show up in the console. The playerCurrentInventoyList has a few items in it while the allInventoryList is empty. So my expected differences would be all the items in playerCurrentInventoryList.
My efforts in comparing the two lists based on the example from the google search does not work. Is anyone willing to offer some suggestions of what I am doing wrong?
thanks.
Oh. Thank you very much!
– voncarp