Skip to content
Snippets Groups Projects
Commit 9df49b2b authored by Erik Johnson's avatar Erik Johnson
Browse files

Merge branch 'issue/13-dynamic-list-item-removed' into 'master'

Merge Request for Issue/13 - dynamic list item removed

Closes #13

See merge request !7
parents 2414a3f4 f9429105
No related branches found
No related tags found
1 merge request!7Merge Request for Issue/13 - dynamic list item removed
......@@ -48,13 +48,19 @@ 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)) {
Destroy(listItems[item].gameObject);
var itemUI = listItems[item];
listItems.Remove(item);
OnItemRemoved(item, itemUI);
Destroy(itemUI.gameObject);
}
}
// --------------------------------------------------------------------------
// Implement if the list needs to do something to the DynamicListItem after it has been added to the list
protected virtual void OnItemAdded(TValueType item, TDynamicListItem itemUI) { }
protected virtual void OnItemAdded(TValueType item, TDynamicListItem itemUI) {}
// --------------------------------------------------------------------------
// Implement if the list needs to do something to the DynamicListItem after it has been removed from the list
protected virtual void OnItemRemoved(TValueType item, TDynamicListItem itemUI) {}
}
}
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