Esempio n. 1
0
    void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.tag != "Player")
        {
            return;
        }

        InventoryController invControl = InventoryController.Instance;

        DroppedItem i = this.GetComponent <DroppedItem>();

        Debug.Log(invControl);

        int numleft = invControl.AutoStackItem(i.Item, i.Qauntity);

        if (numleft == 0)
        {
            //Destroy the collided object
            Destroy(gameObject);
        }
        else
        {
            i.Qauntity = numleft;
        }
    }