Exemplo n.º 1
0
    public void Transaction(float amount)
    {
        TextMeshProUGUI nextMoneyText = moneyTextItems[currentMoneyItem];

        nextMoneyText.gameObject.SetActive(true);
        nextMoneyText.text = amount.ToString();
        Color color = amount > 0 ? profitColorStart : profitColorEnd;
        var   t     = new TransactionAnimation(nextMoneyText, nextMoneyText.rectTransform, transactionDuration, color, amount);

        currentMoneyItem++;
        if (currentMoneyItem > moneyTextItems.Length - 1)
        {
            currentMoneyItem = 0;
        }
        currentTransactions.Add(t);
    }
Exemplo n.º 2
0
    public void Transaction(Item item)
    {
        TextMeshProUGUI nextItemText = itemTextItems[currentTextItem];

        nextItemText.transform.parent.gameObject.SetActive(true);
        nextItemText.text = item.name;
        Debug.Log(item.name);

        var t = new TransactionAnimation(nextItemText, nextItemText.rectTransform, transactionDuration, ItemUtils.RarityColors[item.rarity]);

        t.transactionText.GetComponentInParent <Image>().color = t.color;
        currentTextItem++;
        if (currentTextItem > itemTextItems.Length - 1)
        {
            currentTextItem = 0;
        }
        currentItemTransactions.Add(t);
    }