예제 #1
0
파일: Inventory.cs 프로젝트: Jeunna/Univ
    internal void UseItem(InventoryItemBase item)
    {
        if (ItemUsed != null)
        {
            ItemUsed(this, new InventoryEventArgs(item));
        }

        item.OnUse();
    }
예제 #2
0
    //Funció creada directament desde ItemClickHandler
    internal void UseItem(InventoryItemBase item)
    {
        //Aquest troç de script es repeteix en els tres events: Ara és Utilitzar Item
        if (ItemUsed != null)
        {
            ItemUsed(this, new InventoryEventArgs(item));
        }

        item.OnUse();
    }
예제 #3
0
    public void OnItemClicked()
    {
        InventoryItemBase item = AttachedItem;

        if (item != null)
        {
            _Inventory.UseItem(item);

            item.OnUse();
        }
    }
예제 #4
0
    public void OnItemClicked()
    {
        ItemDragHandler dragHandler =
            gameObject.transform.Find("imageType").GetComponent <ItemDragHandler>();
        InventoryItemBase item = dragHandler.Item;

        Debug.Log(item.Name);

        _Inventory.UseItem(item);

        item.OnUse();
    }
    public void OnItemClicked()
    {
        //todo...stay highlighted or selected if in hand
        m_Button.Select();
        m_Button.OnSelect(null);
        InventoryItemBase item = AttachedItem;

        if (item != null)
        {
            m_Inventory.UseItem(item);

            /*OnUse() sets a predefined behvaior,
             * like transforming the position and rotation of item
             * so it fits in Player's hand.
             */
            item.OnUse();
        }
    }