Beispiel #1
0
    // Schritt 3--------------------------------------------------------------------------------

    public void ProcessRecipeResources()
    {
        CraftItem1UI.GetComponent <Image>().sprite            = SlotItem;
        CraftItem2UI.GetComponent <Image>().sprite            = SlotItem;
        CraftItem3UI.GetComponent <Image>().sprite            = SlotItem;
        CraftItem4UI.GetComponent <Image>().sprite            = SlotItem;
        CraftItem1UI.GetComponentsInChildren <Text>()[0].text = "0";
        CraftItem2UI.GetComponentsInChildren <Text>()[0].text = "0";
        CraftItem3UI.GetComponentsInChildren <Text>()[0].text = "0";
        CraftItem4UI.GetComponentsInChildren <Text>()[0].text = "0";


        if (Res1 != null)
        {
            Sprite Sprite1 = Resources.Load("Grau/" + Res1 + "_grey", typeof(Sprite)) as Sprite;
            CraftItem1UI.GetComponent <Image>().sprite = Sprite1;
        }
        if (Res2 != null)
        {
            Sprite Sprite2 = Resources.Load("Grau/" + Res2 + "_grey", typeof(Sprite)) as Sprite;
            CraftItem2UI.GetComponent <Image>().sprite = Sprite2;
        }
        if (Res3 != null)
        {
            Sprite Sprite3 = Resources.Load("Grau/" + Res3 + "_grey", typeof(Sprite)) as Sprite;
            CraftItem3UI.GetComponent <Image>().sprite = Sprite3;
        }
        if (Res4 != null)
        {
            Sprite Sprite4 = Resources.Load("Grau/" + Res4 + "_grey", typeof(Sprite)) as Sprite;
            CraftItem4UI.GetComponent <Image>().sprite = Sprite4;
        }
        if (rescount1 != 0)
        {
            CraftItem1UI.GetComponentsInChildren <Text>()[0].text = rescount1.ToString();
        }
        if (rescount2 != 0)
        {
            CraftItem2UI.GetComponentsInChildren <Text>()[0].text = rescount2.ToString();
        }
        if (rescount3 != 0)
        {
            CraftItem3UI.GetComponentsInChildren <Text>()[0].text = rescount3.ToString();
        }
        if (rescount4 != 0)
        {
            CraftItem4UI.GetComponentsInChildren <Text>()[0].text = rescount4.ToString();
        }
        if (description != null)
        {
            Description.GetComponent <Text>().text = description;
        }

        // Rezept dem Crafted Item zuweisen
        Sprite CraftedSprite = Resources.Load("Crafted/" + TextofButton, typeof(Sprite)) as Sprite;

        CraftedItem.gameObject.GetComponent <Image>().sprite = CraftedSprite;
        CraftedItem.GetComponentsInChildren <Text>()[0].text = readamount.ToString();
    }