예제 #1
0
    // 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);
    }
예제 #2
0
    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());
    }
예제 #3
0
    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"));
    }
예제 #4
0
 private void Claim(NamedEvent item)
 {
     itemText.Appear(item.GetName());
     pool.Claim(item);
 }