diff --git a/Sane Eric's UI/DynamicList.cs b/Sane Eric's UI/DynamicList.cs index acb1a482892427680f59d70d54aea0cb11e74ca4..98471120722d65472646a4555c1dd69ff48de026 100644 --- a/Sane Eric's UI/DynamicList.cs +++ b/Sane Eric's UI/DynamicList.cs @@ -48,6 +48,7 @@ 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); listItems.Remove(item); } @@ -55,6 +56,10 @@ namespace Shared.SEUI { // -------------------------------------------------------------------------- // 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) {} } }