示例#1
0
文件: Menu.cs 项目: teagh82/HappyTown
 public void Continue()
 {
     activated = false;
     go.SetActive(false);
     theOrder.Move();
     theAudio.Play(cancel_sound);
 }
示例#2
0
    IEnumerator ACoroutine()
    {
        flag = true;
        theOrder.NotMove();
        theNumber.ShowNumber(correctNumber);
        yield return(new WaitUntil(() => !theNumber.activated)); //선택지가 끝나는 순간까지라는 의미

        theOrder.Move();
    }
示例#3
0
    IEnumerator ACoroutine()
    {
        flag = true;
        theOrder.NotMove();
        theChoice.ShowChoice(choice);
        yield return(new WaitUntil(() => !theChoice.choiceIng)); //선택지가 끝나는 순간까지라는 의미

        theOrder.Move();
        Debug.Log(theChoice.GetResult()); //선택됐는지 보여주려고
    }
示例#4
0
    IEnumerator ACoroutine()
    {
        flag = true;
        theOrder.NotMove();

        theDM.ShowText(texts);
        yield return(new WaitUntil(() => !theDM.talking));

        theOrder.Move();
    }
示例#5
0
    IEnumerator EventCoroutine()
    {
        theOrder.PreLoadCharacter();
        theOrder.NotMove();

        theDM.ShowDialogue(dialogue_1);
        yield return(new WaitUntil(() => !theDM.talking)); //대화가 끝날때까지 기다렸다가 대화가 끝나면 이동시킴

        theOrder.Move("Player", "RIGHT");
        theOrder.Move("Player", "RIGHT");
        theOrder.Move("Player", "UP");

        yield return(new WaitForSeconds(1f));

        theDM.ShowDialogue(dialogue_2);
        yield return(new WaitUntil(() => !theDM.talking));

        theOrder.Move();
    }
示例#6
0
文件: Test.cs 项目: teagh82/HappyTown
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name == "Player")
     {
         theOrder.PreLoadCharacter();
         for (int i = 0; i < move.Length; i++)
         {
             theOrder.Move(move[i].name, move[i].direction);
         }
     }
 }
示例#7
0
 public void ExitDialogue()
 {
     text.text = "";
     count     = 0;
     listSentences.Clear();
     listSprites.Clear();
     listDialogueWindows.Clear();
     animSprite.SetBool("Appear", false);
     animDialogueWindow.SetBool("Appear", false);
     talking = false;
     theOrder.Move();
 }
示例#8
0
    // Update is called once per frame
    void Update()
    {
        if (inputKey)
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                activated = !activated;

                if (activated)
                {
                    theOrder.NotMove();
                    theAudio.Play(open_sound);
                    go.SetActive(true);
                    selectedSlot = 0;
                    SelectedSlot();
                    ClearEquip();
                    ShowEquip();
                    ShowTxT();
                }
                else
                {
                    theOrder.Move();
                    theAudio.Play(close_sound);
                    go.SetActive(false);
                    ClearEquip();
                }
            }

            if (activated)
            {
                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (selectedSlot < img_slots.Length - 1)
                    {
                        selectedSlot++;
                    }
                    else
                    {
                        selectedSlot = 0;
                    }
                    theAudio.Play(key_sound);
                    SelectedSlot();
                }
                else if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    if (selectedSlot < img_slots.Length - 1)
                    {
                        selectedSlot++;
                    }
                    else
                    {
                        selectedSlot = 0;
                    }
                    theAudio.Play(key_sound);
                    SelectedSlot();
                }
                else if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    if (selectedSlot > 0)
                    {
                        selectedSlot--;
                    }
                    else
                    {
                        selectedSlot = img_slots.Length - 1;
                    }
                    theAudio.Play(key_sound);
                    SelectedSlot();
                }
                else if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (selectedSlot > 0)
                    {
                        selectedSlot--;
                    }
                    else
                    {
                        selectedSlot = img_slots.Length - 1;
                    }
                    theAudio.Play(key_sound);
                    SelectedSlot();
                }
                else if (Input.GetKeyDown(KeyCode.Z))
                {
                    if (equipItemList[selectedSlot].itemID != 0)
                    {
                        theAudio.Play(enter_sound);
                        inputKey = false;
                        StartCoroutine(OOCCoroutine("벗기", "취소"));
                    }
                }
            }
        }
    }
示例#9
0
    } // 선택된 아이템 반짝임 효과.

    // Update is called once per frame
    void Update()
    {
        if (!stopKeyInput)
        {
            if (Input.GetKeyDown(KeyCode.I))
            {
                activated = !activated;

                if (activated)
                {
                    theAudio.Play(open_sound);
                    theOrder.NotMove();
                    go.SetActive(true);
                    selectedTab   = 0;
                    tabActivated  = true;
                    itemActivated = false;
                    ShowTab();
                }
                else
                {
                    theAudio.Play(cancel_sound);
                    StopAllCoroutines();
                    go.SetActive(false);
                    tabActivated  = false;
                    itemActivated = false;
                    theOrder.Move();
                }
            } // 인벤토리 열고 닫기

            if (activated)
            {
                if (tabActivated)
                {
                    if (Input.GetKeyDown(KeyCode.RightArrow))
                    {
                        if (selectedTab < selectedTabImages.Length - 1)
                        {
                            selectedTab++;
                        }
                        else
                        {
                            selectedTab = 0;
                        }
                        theAudio.Play(key_sound);
                        SelectedTab();
                    }
                    else if (Input.GetKeyDown(KeyCode.LeftArrow))
                    {
                        if (selectedTab > 0)
                        {
                            selectedTab--;
                        }
                        else
                        {
                            selectedTab = selectedTabImages.Length - 1;
                        }
                        theAudio.Play(key_sound);
                        SelectedTab();
                    }
                    else if (Input.GetKeyDown(KeyCode.Z))
                    {
                        theAudio.Play(enter_sound);
                        Color color = selectedTabImages[selectedTab].GetComponent <Image>().color;
                        color.a = 0.25f;
                        selectedTabImages[selectedTab].GetComponent <Image>().color = color;
                        itemActivated = true;
                        tabActivated  = false;
                        preventExec   = true;
                        ShowItem();
                    }
                } // 탭 활성화시 키입력 처리.

                else if (itemActivated)
                {
                    if (inventoryTabList.Count > 0)
                    {
                        if (Input.GetKeyDown(KeyCode.DownArrow))
                        {
                            if (selectedItem + 2 > slotCount)
                            {
                                if (page < (inventoryTabList.Count - 1) / MAX_SLOTS_COUNT)
                                {
                                    page++;
                                }
                                else
                                {
                                    page = 0;
                                }

                                RemoveSlot();
                                ShowPage();
                                selectedItem = -2;
                            }

                            if (selectedItem < slotCount - 1)
                            {
                                selectedItem += 2;
                            }
                            else
                            {
                                selectedItem %= 2;
                            }
                            theAudio.Play(key_sound);
                            SelectedItem();
                        }
                        else if (Input.GetKeyDown(KeyCode.UpArrow))
                        {
                            if (selectedItem - 2 < 0)
                            {
                                if (page != 0)
                                {
                                    page--;
                                }
                                else
                                {
                                    page = (inventoryTabList.Count - 1) / MAX_SLOTS_COUNT;
                                }

                                RemoveSlot();
                                ShowPage();
                            }

                            if (selectedItem > 1)
                            {
                                selectedItem -= 2;
                            }
                            else
                            {
                                selectedItem = slotCount - selectedItem;
                            }
                            theAudio.Play(key_sound);
                            SelectedItem();
                        }
                        else if (Input.GetKeyDown(KeyCode.RightArrow))
                        {
                            if (selectedItem + 1 > slotCount)
                            {
                                if (page < (inventoryTabList.Count - 1) / MAX_SLOTS_COUNT)
                                {
                                    page++;
                                }
                                else
                                {
                                    page = 0;
                                }

                                RemoveSlot();
                                ShowPage();
                                selectedItem = -1;
                            }

                            if (selectedItem < slotCount)
                            {
                                selectedItem++;
                            }
                            else
                            {
                                selectedItem = 0;
                            }
                            theAudio.Play(key_sound);
                            SelectedItem();
                        }
                        else if (Input.GetKeyDown(KeyCode.LeftArrow))
                        {
                            if (selectedItem - 1 < 0)
                            {
                                if (page != 0)
                                {
                                    page--;
                                }
                                else
                                {
                                    page = (inventoryTabList.Count - 1) / MAX_SLOTS_COUNT;
                                }

                                RemoveSlot();
                                ShowPage();
                            }

                            if (selectedItem > 0)
                            {
                                selectedItem--;
                            }
                            else
                            {
                                selectedItem = slotCount;
                            }
                            theAudio.Play(key_sound);
                            SelectedItem();
                        }
                        else if (Input.GetKeyDown(KeyCode.Z) && !preventExec)
                        {
                            if (selectedTab == 0) // 소모품
                            {
                                StartCoroutine(OOCCoroutine("사용", "취소"));
                            }
                            else if (selectedTab == 1)
                            {
                                StartCoroutine(OOCCoroutine("장착", "취소"));
                            }
                            else // 비프음 출력
                            {
                                theAudio.Play(beep_sound);
                            }
                        }
                    }

                    if (Input.GetKeyDown(KeyCode.X))
                    {
                        theAudio.Play(cancel_sound);
                        StopAllCoroutines();
                        itemActivated = false;
                        tabActivated  = true;
                        ShowTab();
                    }
                } // 아이템 활성화시 키입력 처리.

                if (Input.GetKeyUp(KeyCode.Z)) // 중복 실행 방지.
                {
                    preventExec = false;
                }
            } // 인벤토리가 열리면 키입력처리 활성화.
        }
    }