DragItem.createDuplication C# (CSharp) Method

createDuplication() public method

public createDuplication ( UnityEngine Item ) : void
Item UnityEngine
return void
    public void createDuplication(UnityEngine.GameObject Item)
    {
        Item item = Item.GetComponent<ItemOnObject>().item;
        UnityEngine.GameObject duplication = UnityEngine.GameObject.FindGameObjectWithTag("MainInventory").GetComponent<Inventory>().addItemToInventory(item.itemID, item.itemValue);
        duplication.transform.parent.parent.parent.GetComponent<Inventory>().stackableSettings();
        Item.GetComponent<ConsumeItem>().duplication = duplication;
        duplication.GetComponent<ConsumeItem>().duplication = Item;
    }