Пример #1
0
    public void UpdateData()
    {
        var     title          = "";
        var     description    = "";
        var     price          = "";
        Texture iconTexture    = null;
        Texture previewTexture = null;

        if (weaponData != null)
        {
            title          = weaponData.GetTitle();
            description    = weaponData.GetDescription();
            price          = weaponData.GetPriceText();
            iconTexture    = weaponData.iconTexture;
            previewTexture = weaponData.previewTexture;
        }
        if (textTitle != null)
        {
            textTitle.text = title;
        }
        if (textDescription != null)
        {
            textDescription.text = description;
        }
        if (textPrice != null)
        {
            textPrice.text = price;
        }
        if (iconImage != null)
        {
            iconImage.texture = iconTexture;
        }
        if (previewImage != null)
        {
            previewImage.texture = previewTexture;
        }
    }