예제 #1
0
    // Pick new item
    void Pick_Up_Item()
    {
        // Project raycast for action
        RaycastHit2D new_info = Action_Raycast();

        // Match new info to target type
        if (new_info)
        {
            // Item box
            ItemBox current_itembox = new_info.transform.GetComponent <ItemBox>();

            if (current_itembox != null)
            {
                Item new_tool = current_itembox.Open_Box();

                item_slot = new_tool;
                //print(item_slot.name);
                player_ui.Update_Inventory_Item(item_slot.item_id);
                return;
            }
        }
    }