Example #1
0
    private void Update()
    {
        if (element != null)
        {
            if (isLobby)
            {
                return;
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Close();
            }

            if (element.SmallItemIndex.Length != 0)
            {
                if (PlayerItem.GetItemArray(element.SmallItemIndex[0]).index == PlayerItem.GetItemArray(element.SmallItemIndex[1]).index) //둘이 똑같은템 조합이면
                {
                    if (PlayerItem.GetItemArray(element.SmallItemIndex[0]).type == itemType.Usable || PlayerItem.GetItemArray(element.SmallItemIndex[0]).type == itemType.Item)
                    {
                        if (PlayerItem.GetUsableItemCount(element.SmallItemIndex[0]) >= 2)
                        {
                            InventBtn.interactable = true;
                            CanCombine             = true;
                        }
                        else
                        {
                            InventBtn.interactable = false;
                            CanCombine             = false;
                        }
                    }
                    else
                    {
                        if (PlayerItem.GetItemCount(element.SmallItemIndex[0]) >= 2)
                        {
                            InventBtn.interactable = true;
                            CanCombine             = true;
                        }
                        else
                        {
                            InventBtn.interactable = false;
                            CanCombine             = false;
                        }
                    }
                }
                else
                {
                    if (PlayerItem.GetItemArray(element.SmallItemIndex[0]).index != 0 && PlayerItem.GetItemArray(element.SmallItemIndex[1]).index != 0)
                    {
                        InventBtn.interactable = true;
                        CanCombine             = true;
                    }
                    else
                    {
                        InventBtn.interactable = false;
                        CanCombine             = false;
                    }
                }
            }
            else
            {
                InventBtn.interactable = false;
                CanCombine             = false;
            }
        }
    }