示例#1
0
    public void Appear(string identifier)
    {
        gameObject.SetActive(true);
        timerItemText.Run();

        textItemName.text        = UtilTranslate.ItemName(identifier);
        textItemDescription.text = UtilTranslate.ItemDescription(identifier);
    }
示例#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;
        string itemName = itemPoolItem.GetName();

        item.SetSprite(itemName);
        item.SetItemName(UtilTranslate.ItemName(itemName));
        item.SetItemProperties(itemPoolItem.GetDescriptionList("\n"));
    }