Skip to content
Snippets Groups Projects

Merge Request for Issue/13 - dynamic list item removed

Merged Heine, Eric R requested to merge issue/13-dynamic-list-item-removed into master
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
@@ -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) {}
}
}
Loading