public void ChangeItemSlot(ItemFunction item, ItemFunction slot)
    {
        //slot = item;
        slot.isBlank = false;
        item.isBlank = true;

        //setIcon logic
        int tempIconNumber;

        tempIconNumber = item.GetIconNumber();
        item.itemImage.SetActive(false);
        slot.itemImage = slot.icons[tempIconNumber];
        slot.SetIconNumber(tempIconNumber);
        slot.itemImage.SetActive(true);


        //Name Swap Logic
        slot.SetName(item.GetName());
        item.name = null;


        //Price Swap Logic
        slot.SetPrice(item.GetPrice());
        item.SetPrice(0.0f);

        //Quality Swap Logic
        slot.SetItemQuality(item.GetQuality());
        item.SetItemQuality(0.0f);

        //Tag Swap Logic
        string tagSwap;

        tagSwap = slot.GetTag();
        slot.SetTag(item.GetTag());
        item.SetTag(tagSwap);
        tagSwap = null;

        //Swap enchantment if item has it
        if (item.isEnchanted == true)
        {
            item.EnchantOff();
            slot.EnchantOn();
        }

        //Swap item type string
        string tempType;

        tempType = item.GetItemType();
        item.SetItemType("");
        slot.SetItemType(tempType);

        //Swap Colour logic
        Color tempColour;

        tempColour = item.GetImageColour();
        item.SetImageColour(new Color(1, 1, 1));
        slot.SetImageColour(tempColour);
    }
 public void DeleteItem(ItemFunction item)
 {
     item.isBlank = true;
     if (itemImage != null)
     {
         item.itemImage.SetActive(false);
     }
     item.SetName(null);
     item.SetPrice(0);
     item.SetItemQuality(0);
     item.SetTag("EmptySlot");
     item.SetItemType("");
     if (item.GetEnchant())
     {
         item.EnchantOff();
     }
 }
    public void ConvertToWeapon(ItemFunction slot, float item1Qual, float item2Qual, float item3Qual, float item1Price, float item2Price, float item3Price, string newTag, Color I1Colour, Color I2Colour, Color I3Colour)
    {
        slot.quality   = ((item1Qual + item2Qual + item3Qual) / 3);
        slot.price     = (item1Price + item2Price + item3Price) * 1.2f;
        slot.tag       = "Item";
        slot.itemImage = sword;
        slot.SetItemType("Sword");
        slot.itemImage.SetActive(true);
        slot.iconNumber = 4;
        slot.itemImage.GetComponent <Image>().color = new Color(((I1Colour.r + I2Colour.r + I3Colour.r) / 3), ((I1Colour.g + I2Colour.g + I3Colour.g) / 3), ((I1Colour.b + I2Colour.b + I3Colour.b) / 3));
        string caseList = newTag;

        switch (caseList)
        {
        case "Sword":
            string nameAddon = SwordNames[Random.Range(0, SwordNames.Length - 1)];
            slot.gameObject.name = ("Sword of " + nameAddon);
            break;
        }
    }
    // Update is called once per frame
    void Update()
    {
        infoText.text  = forgeInfo;
        forgeCost.text = (Mathf.RoundToInt(price) + "G");
        if (ForgePart != null && ForgeMaterial != null)
        {
            Debug.Log("Creating item");
            ItemFunction PartFunc, MatFunc;

            MatFunc  = ForgeMaterial.GetComponent <ItemFunction>();
            PartFunc = ForgePart.GetComponent <ItemFunction>();
            resultFunc.SetItemType(PartFunc.GetItemType());
            resultFunc.SetName((MatFunc.GetName() + " " + PartFunc.GetName()));
            resultFunc.SetItemQuality(MatFunc.GetQuality());
            resultFunc.SetTag("Item");
            string CaseTpye = MatFunc.GetName();
            switch (CaseTpye)
            {
            case "Iron":
                matColour = new Color(0.4823529f, 0.4823529f, 0.4823529f);
                break;

            case "Copper":
                matColour = new Color(0.8862745f, 0.5921569f, 0.1529412f);
                break;

            case "Bronze":
                matColour = new Color(0.5849056f, 0.4014046f, 0.06897471f);
                break;

            case "Mythril":
                matColour = new Color(0.6427109f, 0.9528301f, 0.9528302f);
                break;
            }
            resultFunc.SetIcon(PartFunc.GetIconNumber());
            resultFunc.SetImageColour(matColour);
            Debug.Log(resultFunc.GetImageColour());
            resultFunc.SetPrice(PartFunc.GetPrice() * MatFunc.GetPrice());
            price = resultFunc.GetPrice();
        }
    }