public void Set(Regulus.Project.ItIsNotAGame1.Data.Item item)
    {
        _Item = item;
        Name.text =  item.Count.ToString();

        Image.sprite = (Sprite)UnityEngine.Resources.Load("Icon/Item/" + _Item.Name , typeof(Sprite));
    }
Exemple #2
0
    public void Set(Regulus.Project.ItIsNotAGame1.Data.Item item)
    {
        _Item     = item;
        Name.text = item.Count.ToString();

        Image.sprite = (Sprite)UnityEngine.Resources.Load("Icon/Item/" + _Item.Name, typeof(Sprite));
    }
Exemple #3
0
    protected void _CreateItem(Regulus.Project.ItIsNotAGame1.Data.Item item)
    {
        var slot = GameObject.Instantiate(ItemSource);

        var rectTransform = slot.GetComponent <RectTransform>();

        rectTransform.SetParent(transform);
        slot.GetComponent <GameItem>().Set(item);
        var button = slot.GetComponent <UnityEngine.UI.Button>();

        button.onClick.AddListener(
            () =>
        {
            Description.Set(item);
        });
    }