예제 #1
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));
    }
예제 #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));
    }
예제 #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);
        });
    }