private void CollectItemHandler(CollectableItem aItem) { aItem.EventCollected -= CollectItemHandler; // Remove collected item from our memory. int index = _items.FindIndex(x => x.kind == aItem.kind); if (index >= 0 && index < _items.Count) { _items.RemoveAt(index); } }
private void ItemCollectHandler(CollectableItem aItem) { // If item of this spawner is collected, so enable spawner to spawn new item. aItem.EventCollected -= ItemCollectHandler; _isActive = true; }
private void ItemCollectHandler(CollectableItem aItem) { aItem.EventCollected -= ItemCollectHandler; collectableItems.Remove(aItem); }