예제 #1
0
    //아이템 우클릭
    void ItemRightClick()
    {
        if (isMouseTracking)
        {
            if (InventoryAutoInput())
            {
                isMouseTracking             = false;
                inventoryManager.isItemDrag = false;
                ItemReturnPosition();
                DontEquipmentItemImageSet();
            }
            else
            {
                Debug.Log("빈공간이 부족해");
            }
        }
        else
        {
            if (!isEquipment)
            {
                RemoveArr();

                if (shopManager.isOn)
                {
                    ItemSellCheck();
                }
                else //아이템 우클릭 착용
                {
                    if (itemKind == ItemKind.use)
                    {
                        //소모품 먹는 로직 추가
                        UsePotion();
                        Destroy(this.gameObject);
                        return;
                    }

                    //if (needLevel > PlayerManager.instance.Level) return;

                    equipmentManager.ClickEquipment(ref itemManager);
                    if (itemKind == ItemKind.LHand)
                    {
                        equipmentManager.WeaponSet(weaponNum);
                    }

                    equipmentManager.ItemStatusSet();
                    EquipmentItemImgSet();
                }
            }
            else
            {
                transform.parent = inventoryTr;
                if (inventoryManager.AutoItemInput(ref itemManager))  //아이템 우클릭 벗기
                {
                    ItemReturnPosition();
                    equipmentManager.ItemStatusSet();
                    isEquipment = false;
                    DontEquipmentItemImageSet();
                }
                else
                {
                    Debug.Log("아이템에 공간이 없다");
                }
            }
        }
    }