コード例 #1
0
ファイル: Inventory.cs プロジェクト: skywhorl/Eliminator
    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);
    }
コード例 #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);
    }
コード例 #3
0
    }//선택된 슬롯 점멸효과

    IEnumerator OoCCoroutine(string _Y, string _N)
    {
        ui.PlaySound(enter_sound);
        stopKeyInput = true;

        goOOC.SetActive(true);
        theOOC.ShowChoice(_Y, _N);
        yield return(new WaitUntil(() => !theOOC.activated));

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

                        if (inventoryItemList[i].itemCount > 1)
                        {
                            inventoryItemList[i].itemCount--;
                        }
                        else
                        {
                            inventoryItemList.RemoveAt(i);
                        }
                        ShowItem();
                        break;
                    }
                }
                else if (selectedTab == 1)
                {
                    if (inventoryItemList[i].itemID == slots[selectedItem].itemID)
                    {
                        Debug.Log(i + "/" + inventoryItemList[i].itemID + "/" + inventoryTabList[selectedItem].itemID);
                        ui.EquipItem(inventoryItemList[i]);
                        inventoryItemList.RemoveAt(i);
                        ShowItem();
                        break;
                    }
                }
            }
        }
        stopKeyInput = false;
        goOOC.SetActive(false);
    }
コード例 #4
0
ファイル: Inventory.cs プロジェクト: teagh82/HappyTown
    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);
    }
コード例 #5
0
    IEnumerator OoCCoroutine(string _Y, string _N)
    {
        goOOC.SetActive(true);
        theOOC.ShowChoice(_Y, _N);
        yield return(new WaitUntil(() => !theOOC.activated));

        if (theOOC.GetResult())
        {
            ui.ReturnItem(equipmentList[selectedSlot]);
            TakeOffEffect(equipmentList[selectedSlot]);
            ShowText();
            if (selectedSlot == WEAPON)
            {
                equipedWeapon.SetActive(false);
            }
            else if (selectedSlot == ARMOR)
            {
                equipedArmor[0].GetComponent <SpriteRenderer>().sprite = armors[0];
                equipedArmor[1].GetComponent <SpriteRenderer>().sprite = leftArm[0];
                equipedArmor[2].GetComponent <SpriteRenderer>().sprite = rightArm[0];
            }
            else if (selectedSlot == GAUNTLET)
            {
                equipedGauntlets[0].GetComponent <SpriteRenderer>().sprite = rightGauntlets[0];
                equipedGauntlets[1].GetComponent <SpriteRenderer>().sprite = rightGauntlets[0];
            }
            else if (selectedSlot == PANTS)
            {
                equipedPants[0].GetComponent <SpriteRenderer>().sprite = pants[0];
                equipedPants[1].GetComponent <SpriteRenderer>().sprite = leftLeg[0];
                equipedPants[2].GetComponent <SpriteRenderer>().sprite = rightLeg[0];
                equipedPants[3].GetComponent <SpriteRenderer>().sprite = leftGuard[0];
                equipedPants[4].GetComponent <SpriteRenderer>().sprite = rightGuard[0];
            }
            else if (selectedSlot == BOOTS)
            {
                equipedBoots[0].GetComponent <SpriteRenderer>().sprite = leftBoots[0];
                equipedBoots[1].GetComponent <SpriteRenderer>().sprite = rightBoots[0];
            }
            equipmentList[selectedSlot] = new Item(0, "", "", Item.ItemType.Equip);
            ui.PlaySound(takeoffSound);
            ClearEquip();
            ShowEquip();
        }
        inputKey = true;
        goOOC.SetActive(false);
    }
コード例 #6
0
ファイル: Equipment.cs プロジェクト: teagh82/HappyTown
    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);
    }
コード例 #7
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);
    }
コード例 #8
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);
    }