Пример #1
0
    public void SetInfo()
    {
        Text   text     = ItemText.GetComponent <Text>();
        string iteminfo = text.text;

        item = ItemCatalog.GetRandomItem();

        if (isBuy)
        {
            iteminfo = item.GetName() + "   " + item.GetLowCost();
        }
        else
        {
            iteminfo = item.GetName() + "   " + item.GetHighCost();
        }

        text.text = iteminfo;
    }
Пример #2
0
    public void GenerateStock(int qty)
    {
        for (int i = 0; i < qty; i++)
        {
            Item item = ItemCatalog.GetRandomItem();

            // Random cost variance
            if (realm == item.baseItem.realm)
            {
                item.currentCost = (int)(item.GetLowCost() * (1 + Random.Range(-buyVar, buyVar)));
            }
            else
            {
                item.currentCost = (int)(item.GetHighCost() * (1 + Random.Range(-buyVar, buyVar)));
            }

            stock.Add(item);
        }
    }