Skip to content
Snippets Groups Projects
Commit f9429105 authored by Heine, Eric R's avatar Heine, Eric R
Browse files

The item is now removed from the dictionary of list items before calling the...

The item is now removed from the dictionary of list items before calling the OnItemRemoved function, but the root GameObject is destroyed afterwards just to make sure Unity isn't doing any cleanup before a derived class has a chance to.
parent dd0be219
No related branches found
No related tags found
1 merge request!7Merge Request for Issue/13 - dynamic list item removed
......@@ -48,9 +48,10 @@ namespace Shared.SEUI {
// Remove the given item from the list (if it is in the list)
public void RemoveItem(TValueType item) {
if (listItems.ContainsKey(item)) {
OnItemRemoved(item, listItems[item]);
Destroy(listItems[item].gameObject);
var itemUI = listItems[item];
listItems.Remove(item);
OnItemRemoved(item, itemUI);
Destroy(itemUI.gameObject);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment