Beispiel #1
0
    public void Drop(ItemStack stack)
    {
        ItemContainer drop = Instantiate(ResourcesLoader.LoadPref("ItemContainer")).GetComponent <ItemContainer>();

        drop.transform.position = transform.position;
        drop.SetItem(stack);
    }
Beispiel #2
0
    private void AddStack(ItemStack stack)
    {
        Slot     freeSlot = slots.FirstOrDefault(x => !x.isBlock);
        DragItem dragItem = Instantiate(ResourcesLoader.LoadPref("ItemIcon")).GetComponent <DragItem>();

        dragItem.InitItem(stack);
        dragItem.SetSlot(freeSlot);
    }