// Callback for when the player collects the item. private void Claim(NamedEvent item) { string identifier = item.GetName(); itemText.Appear(identifier); player.AddItemVisualEffect(identifier); pool.Claim(item); }
private void SpawnItem(Transform parent, NamedEvent itemPoolItem) { GameObject obj = Instantiate(prefabUpgradeItem, parent); obj.transform.localPosition = Vector3.zero; UpgradeItem item = obj.GetComponent <UpgradeItem>(); item.Collected += itemPoolItem.OnInvoked; item.Collected += DestroyItems; item.SetSprite(itemPoolItem.GetName()); }
private void SpawnItem(Transform parent, NamedEvent itemPoolItem) { GameObject obj = Instantiate(prefabUpgradeItem, parent); obj.transform.localPosition = Vector3.zero; UpgradeItem item = obj.GetComponent <UpgradeItem>(); item.Collected += itemPoolItem.OnInvoked; item.Collected += DestroyItems; string itemName = itemPoolItem.GetName(); item.SetSprite(itemName); item.SetItemName(UtilTranslate.ItemName(itemName)); item.SetItemProperties(itemPoolItem.GetDescriptionList("\n")); }
private void Claim(NamedEvent item) { itemText.Appear(item.GetName()); pool.Claim(item); }