예제 #1
0
    public void SlotSetting(Item _item)
    {
        SettingEnabled(true);

        item = _item;

        Sprite newSprite = Resources.Load <Sprite>("Images/Items/" + _item.PrefabName);

        this.ItemImage.sprite = newSprite;
        ItemCountText.text    = _item.ItemCount.ToString();

        SlotObjectItem slotObjectItem = ItemImage.gameObject.GetComponent <SlotObjectItem>();

        slotObjectItem.item = _item;
    }
예제 #2
0
 public virtual void UseSlotObject()
 {
     if (slotType == SLOT_TYPE.ITEM_SLOT)
     {
         Debug.Log("item");
         SlotObjectItem obj = gameObject.GetComponent <SlotObjectItem>();
         obj.UseItem();
     }
     else if (slotType == SLOT_TYPE.SKILL_SLOT)
     {
         Debug.Log("skill");
         SlotObjectSkill obj = gameObject.GetComponent <SlotObjectSkill>();
         obj.UseSkill();
     }
 }