Example #1
0
    public void Open(tem taaaaam)
    {
        if (!isLobby)
        {
            if (XBtn.activeSelf)
            {
                XBtn.SetActive(false);
            }
            if (player.isPlay)
            {
                pause.canPause = false;
            }
        }
        if (!dicBtn.activeSelf)
        {
            dicBtn.SetActive(true);
        }
        if (!Com.activeSelf)
        {
            Com.SetActive(true);
        }
        if (Dic.activeSelf)
        {
            Dic.SetActive(false);
        }
        element = taaaaam;
        isOpen  = true;
        anim.Play("InvenOpen");
        tem tem;

        for (int i = 0; i < completeTemArray.Length; i++)
        {
            completeTemArray[i].canSee = true;
        }

        for (int i = 0; i < element.CompleteItemIndex.Length; i++)
        {
            tem = temMgr.GetItemList(element.CompleteItemIndex[i]);
            completeTemArray[i] = tem.DeepCopy();
        }

        for (int i = element.CompleteItemIndex.Length; i < completeTemArray.Length; i++)
        {
            completeTemArray[i].canSee = false;
        }


        for (int i = 0; i < completeTemArray.Length; i++)
        {
            if (completeTemArray[i].canSee)
            {
                completeBoxes[i].gameObject.SetActive(true);
                completes[i].gameObject.SetActive(true);
                completes[i].sprite = completeTemArray[i].ItemSprite;
            }
            else
            {
                completes[i].gameObject.SetActive(false);
                completeBoxes[i].gameObject.SetActive(false);
            }
        }

        if (element != null)
        {
            if (element.SmallItemIndex.Length >= 2)
            {
                Big.SetActive(false);
                Small.SetActive(true);
                SmallItemImg1.sprite = temMgr.GetItemList(element.SmallItemIndex[0]).ItemSprite;
                SmallItemImg2.sprite = temMgr.GetItemList(element.SmallItemIndex[1]).ItemSprite;
                if (pc.isKor())
                {
                    SmallItemName1.text = temMgr.GetItemList(element.SmallItemIndex[0]).ItemName;
                }
                else
                {
                    SmallItemName1.text = temMgr.GetItemList(element.SmallItemIndex[0]).ItemName2;
                }
                SmallType1.text = getType(temMgr.GetItemList(element.SmallItemIndex[0]).type);
                if (pc.isKor())
                {
                    SmallItemName2.text = temMgr.GetItemList(element.SmallItemIndex[1]).ItemName;
                }
                else
                {
                    SmallItemName2.text = temMgr.GetItemList(element.SmallItemIndex[1]).ItemName2;
                }
                SmallType2.text    = getType(temMgr.GetItemList(element.SmallItemIndex[1]).type);
                BigItemImg2.sprite = element.ItemSprite;
                if (pc.isKor())
                {
                    BigItemName2.text = element.ItemName;
                }
                else
                {
                    BigItemName2.text = element.ItemName2;
                }
                BigType2.text = getType(element.type);
            }
            else
            {
                Big.SetActive(true);
                Small.SetActive(false);
                BigItemImg.sprite = element.ItemSprite;
                if (pc.isKor())
                {
                    BigItemName.text = element.ItemName;
                }
                else
                {
                    BigItemName.text = element.ItemName2;
                }
                BigType.text = getType(element.type);
            }
            if (pc.isKor())
            {
                ItemName.text = element.ItemName;
            }
            else
            {
                ItemName.text = element.ItemName2;
            }

            if (pc.isKor())
            {
                ItemDescription.text = element.ItemDescription;
            }
            else
            {
                ItemDescription.text = element.ItemDescription2;
            }
            if (pc.isKor())
            {
                WhereGet.text = "획득 경로 : " + element.WhereGet;
            }
            else
            {
                WhereGet.text = "Can get at : " + element.WhereGet2;
            }
        }
    }