Ejemplo n.º 1
0
    IEnumerator OOCCoroutine()
    {
        go_OOC.SetActive(true);
        theOOC.ShowTwoChoice("사용", "취소");
        yield return(new WaitUntil(() => !theOOC.activated));

        if (theOOC.GetResult())
        {
            // 아이템 사용 후 탭 줄이기(2개 이상이면 1 줄이기)
            for (int i = 0; i < inventoryItemList.Count; i++)
            {
                if (inventoryItemList[i].itemID == inventoryItemList[selectedItem].itemID)
                {
                    theDatabase.UseItem(inventoryItemList[i].itemID);
                    if (inventoryItemList[i].itemCount > 1)
                    {
                        inventoryItemList[i].itemCount--;
                    }
                    else
                    {
                        inventoryItemList.RemoveAt(i); // i번째의 인벤토리 제외
                    }
                    //theAudio.Play(beep_sound); 아이템 먹는 소리 출력
                    ShowItem();
                    break;
                }
            }
        }
        stopKeyInput = false;
        go_OOC.SetActive(false);
    }
Ejemplo n.º 2
0
    IEnumerator OOCCoroutine()
    {
        go_OOC.SetActive(true);
        ooc.ShowTwoChoice("Use", "Cancel");
        yield return(new WaitUntil(() => !ooc.activated));

        if (ooc.GetResult())
        {
            for (int i = 0; i < inventoryItemList.Count; i++)
            {
                if (inventoryItemList[i].itemID == inventoryTapList[selectedItem].itemID)
                {
                    database.UseItem(inventoryItemList[i].itemID);
                    if (inventoryItemList[i].itemCount > 1)
                    {
                        inventoryItemList[i].itemCount--;
                    }
                    else
                    {
                        inventoryItemList.RemoveAt(i);
                    }
                    ShowItem();
                    break;
                }
            }
        }

        stopKeyInput = false;
        go_OOC.SetActive(false);
    }
Ejemplo n.º 3
0
    IEnumerator OOCCoroutine(string _up, string _down)
    {
        theAudio.Play(enter_sound);
        stopKeyInput = true;

        go_OOC.SetActive(true);
        theOOC.ShowTwoChoice(_up, _down);

        yield return(new WaitUntil(() => !theOOC.activated));

        if (theOOC.GetResult())
        {
            for (int i = 0; i < inventoryItemList.Count; i++)
            {
                if (inventoryItemList[i].itemID == inventoryTabList[selectedItem].itemID)
                {
                    if (selectedTab == 0)
                    {
                        theDatabase.UseItem(inventoryItemList[i].itemID);

                        if (inventoryItemList[i].itemCount > 1)
                        {
                            inventoryItemList[i].itemCount--;
                        }
                        else
                        {
                            inventoryItemList.RemoveAt(i);
                        }

                        // theAudio.Play() // 아이템 먹는 소리 출력.

                        ShowItem();
                        break;
                    }
                    else if (selectedTab == 1)
                    {
                        theEquip.EquipItem(inventoryItemList[i]);
                        inventoryItemList.RemoveAt(i);
                        ShowItem();
                        break;
                    }
                }
            }
        }
        stopKeyInput = false;
        go_OOC.SetActive(false);
    }
Ejemplo n.º 4
0
    IEnumerator OOCCoroutine(string _up, string _down)
    {
        go_OOC.SetActive(true);
        theOOC.ShowTwoChoice(_up, _down);
        yield return(new WaitUntil(() => !theOOC.activated));

        if (theOOC.GetResult())
        {
            theInven.EquipToInventory(equipItemList[selectedSlot]);
            TakeOffEffect(equipItemList[selectedSlot]);
            ShowTxT();
            equipItemList[selectedSlot] = new Item(0, "", "", Item.ItemType.Equip);
            theAudio.Play(takeoff_sound);
            ClearEquip();
            ShowEquip();
        }
        inputKey = true;
        go_OOC.SetActive(false);
    }
Ejemplo n.º 5
0
    IEnumerator OOCCorutine(string _up, string _down)
    {
        theAudio.Play(enter_sound);
        stopKeyInput = true; //
        go_OOC.SetActive(true);
        OOC.ShowTwoChoice(_up, _down);
        yield return(new WaitUntil(() => !OOC.activate));

        if (OOC.GetResult())
        {
            for (int i = 0; i < inventoryItemList.Count; i++)
            {
                if (inventoryItemList[i].itemID == inventoryCategoryList[selectedItem].itemID)
                {
                    if (selectedCategory == 0)
                    {
                        theDatabase.UseItem(inventoryItemList[i].itemID);
                        if (inventoryItemList[i].itemCount > 1)
                        {
                            --inventoryItemList[i].itemCount;
                        }
                        else
                        {
                            inventoryItemList.RemoveAt(i);
                        }
                        ShowItem();
                        break;
                    }
                    else if (selectedCategory == 1)
                    {
                        theEQ.EquipItem(inventoryItemList[i]);
                        inventoryItemList.RemoveAt(i);
                        ShowItem();
                    }
                }
            }
        }
        stopKeyInput = false;
        go_OOC.SetActive(false);
    }
Ejemplo n.º 6
0
    IEnumerator OOCCorutine(string _up, string _down)
    {
        go_OOC.SetActive(true);
        OOC.ShowTwoChoice(_up, _down);
        yield return(new WaitUntil(() => !OOC.activate));

        if (OOC.GetResult())
        {
            theInven.EquipToInventory(equimentList[selectedNumber]);
            theAudio.Play(take_off_Sound);
            ClearEquip();
            TakeOffItem(equimentList[selectedNumber]);
            if (selectedNumber == WEAPON)
            {
                weaponTest.SetActive(false);
            }
            equimentList[selectedNumber] = new Item(0, "", "", Item.ItemType.EQUIPIMENT, 0);
            ShowStat();
            ShowEquip();
        }
        keyInput = true;
        go_OOC.SetActive(false);
    }