Example #1
0
    //Clear the info box
    public void emptyInfoBox()
    {
        infoBox.transform.GetChild(0).gameObject.SetActive(false);
        infoBox.transform.GetChild(1).GetComponent <TextMeshProUGUI>().text = "";
        infoBox.transform.GetChild(2).GetComponent <TextMeshProUGUI>().text = "";
        infoBox.transform.GetChild(3).GetComponent <TextMeshProUGUI>().text = "";
        infoBox.transform.GetChild(4).GetComponent <TextMeshProUGUI>().text = "";
        infoBox.transform.GetChild(5).transform.gameObject.SetActive(false);

        activeSlot = null;
        activeItem = null;
    }
Example #2
0
    //Set up the info box with the appropriate info given by the button selected
    public void showItemInfoBox(Sprite s, string name, string damage, string range, string price, TraderSlot slot, Item active)
    {
        infoBox.transform.GetChild(0).gameObject.SetActive(true);
        infoBox.transform.GetChild(0).GetComponent <Image>().sprite         = s;
        infoBox.transform.GetChild(1).GetComponent <TextMeshProUGUI>().text = name;
        infoBox.transform.GetChild(2).GetComponent <TextMeshProUGUI>().text = "Damage: " + damage;
        infoBox.transform.GetChild(3).GetComponent <TextMeshProUGUI>().text = "Range: " + range;
        infoBox.transform.GetChild(4).GetComponent <TextMeshProUGUI>().text = "Price: " + price;
        infoBox.transform.GetChild(5).transform.gameObject.SetActive(true);

        activeSlot = slot;
        activeItem = active;
    }