Exemple #1
0
    public void collectStuff(Transform t)
    {
        ressource ressource = t.GetComponent <ressource>();

        if (ressource != null)
        {
            bool ok = inventory.AddToSlots(ressource.item);
            if (ok)
            {
                asteroidBelt.DeleteItem(t);
            }
            //Destroy(t.gameObject);
        }
    }
Exemple #2
0
    public void buy(item i, bool buy)
    {
        bool okay = inv.AddMoney(-i.cost);

        if (!okay)
        {
            speechBubble.text = "get some money!";
            return;
        }
        speechBubble.text = thx[Random.Range(0, thx.Length)];
        bool ok = inv.AddToSlots(items.instance.GetIndex(i));

        if (!ok)
        {
            inv.AddMoney(i.cost);
            speechBubble.text = "your inventory is full you stupid piece of shit";
        }
    }