Exemple #1
0
    // 이름 입력 패널 등장 이펙트
    IEnumerator ShowNamePannel(Image target)
    {
        target.color = Color.clear;                                               // 패널 투명하게
        inputNamePannel.SetActive(true);                                          // 패널 활성화
        GameObject inputField = inputNamePannel.transform.GetChild(0).gameObject; // 인풋필드

        inputField.SetActive(false);                                              // 인풋필드 비활성화
        yield return(StartCoroutine(te.FadeInObject(target, 0.5f)));              // 서서히 나타나는 효과

        inputField.SetActive(true);                                               // 인풋필드 활성화
        inputField.transform.GetComponent <InputField>().Select();                // 인풋필드 커서 활성화
        yield return(null);
    }
Exemple #2
0
    //퀘스트 1_2 움막을 짓자 진행 부분
    IEnumerator QuestStart()
    {
        yield return(null);

        JoyStickManager.Instance.CanvasDisable();

        string comment    = "'재수없는 다시마에게서 움막을 받았다. \n움막설치를 원하는 장소에서 \n퀘스트창을 열고 텐트를 눌러서 사용해보자'";
        int    commentIdx = 0;
        bool   isClick    = true;

        //퀘스트 내용 부분
        panel.SetActive(true);

        yield return(StartCoroutine(talkEffect.FadeInObject(panelImage, 0.5f)));

        yield return(null);

        while (commentIdx < comment.Length)
        {
            panelText.text += comment[commentIdx];
            commentIdx++;
            yield return(new WaitForSeconds(0.03f));
        }

        while (isClick)
        {
            if (Input.GetMouseButton(0))
            {
                isClick = false;
            }
            yield return(null);
        }

        isClick        = true;
        panelText.text = "";
        panel.SetActive(false);

        yield return(null);


        //퀘스트 내용이 다 나오고 움직임 재생부분
        ctrl.enabled           = true;
        playerMovement.enabled = true;
        JoyStickManager.Instance.CanvasAble();

        QuestManager.instance.AddQuest("생존을 위한 움막을 짓자2", "움막설치를 원하는 장소에서 퀘스트창을 열고 텐트를 사용해보자", "itemIcon/80000011", "Quest1_2", "UsingQuest");
        PlayerFunctions.instance.SetDefaultInput();
    }
Exemple #3
0
    IEnumerator CommentPrinter(string comment)
    {   // 입력받은 코멘트를 순차적으로 출력하는 코루틴
        yield return(null);

        JoyStickManager.Instance.CanvasDisable(); // 조이스틱을 가려 채팅이 가려지지않게함

        if (panel == null)
        {
            panel = GameObject.Find("ChattingCanvas").transform.GetChild(0).gameObject;
        }
        if (button == null)
        {
            button = GameObject.Find("ChattingCanvas").transform.GetChild(1).gameObject;
        }

        // 필요한 변수가 null이 아닌지 체크
        panel.SetActive(true);
        if (panelImage == null)
        {
            panelImage = panel.gameObject.GetComponentInChildren <Image>();
        }
        if (panelText == null)
        {
            panelText = panel.gameObject.GetComponentInChildren <Text>();
        }
        panel.SetActive(false);
        if (talkEffect == null)
        {
            talkEffect = FindObjectOfType <TalkEffect>();
        }

        int  commentIdx = 0;
        bool isClick    = true;

        panel.SetActive(true);                                                   // 텍스트 패널 활성화
        button.SetActive(true);                                                  // 스킵버튼 활성화

        yield return(StartCoroutine(talkEffect.FadeInObject(panelImage, 0.5f))); // 패널이 서서히 나타남

        yield return(null);

        panelText.text = "";
        while (commentIdx < comment.Length && !stopComment)
        {
            if (!panel.activeSelf)
            {
                panel.SetActive(true);             // 패널이 꺼진경우 다시 켬
            }
            panelText.text += comment[commentIdx]; // 텍스트를 한글자씩 추가함
            commentIdx++;
            if (Input.GetMouseButtonDown(0))
            {   // 사용자 입력이 있는경우 텍스트가 끝까지 한번에 출력됨
                panelText.text = comment;
                commentIdx     = comment.Length;
            }
            yield return(new WaitForSeconds(0.03f));
        }

        yield return(null);

        while (isClick && !stopComment)
        {   // 출력이 완료되면 사용자 입력을 기다림
            if (Input.GetMouseButtonDown(0))
            {
                isClick = false;
            }
            yield return(null);
        }
        panelText.text = "";
        panel.SetActive(false);  // 패널 비활성화
        button.SetActive(false); // 버튼 비활성화

        stopComment = false;

        yield return(null);

        JoyStickManager.Instance.CanvasAble();
    }
Exemple #4
0
    IEnumerator QuestPlay()// 대사와 동작를 지정해주는 함수
    {
        yield return(null);

        for (int i = 0; i < QuestManager.instance.questList.Count; i++)
        {
            if (QuestManager.instance.questList[i].QuestName == "#생존을 위한 움막을 짓자1")
            {
                ctrl.transform.GetChild(0).GetComponent <Animator>().enabled = true;

                ctrl.enabled           = true;
                playerMovement.enabled = true;
                ctrl.transform.Rotate(90, 0, 0);
                ctrl.transform.Rotate(0, 180, 0);//플레이어 시작로테이트
                ctrl.transform.position = new Vector3(85, 1, 11);

                StopAllCoroutines();
            }
            yield return(null);
        }

        JoyStickManager.Instance.CanvasDisable();         //조이스틱멈추고

        FindObjectOfType <HealthManager>().AddHealth(10); //체력10
        FindObjectOfType <FoodManager>().addFOOD(10);     //배고픔10


        string quest1 = "으.....머리야 눈부셔 여긴어디지???";//대화추가
        bool   click  = true;

        ScriptPannel.SetActive(true);                                             //대화창활성화
        yield return(StartCoroutine(talkEffect.FadeInObject(ScriptImage, 0.5f))); //이코르틴이 끝날때까지 기다림 yield return

        for (int i = 0; i < quest1.Length; i++)
        {
            ScriptText.text += quest1[i];//한글자씩 ScriptText.text에 집어넣어줌
            yield return(new WaitForSeconds(0.03f));
        }
        while (click)//클릭했을때 대화를 빠르게 넘김
        {
            if (Input.GetMouseButtonDown(0))
            {
                click = false;
            }
            yield return(null);
        }
        click           = true;
        ScriptText.text = "";
        yield return(null);

        yield return(StartCoroutine(talkEffect.FadeOutObject(ScriptImage, 0.5f)));

        ScriptPannel.SetActive(false);

        ctrl.transform.Rotate(90, 0, 0);


        string[] comments_a = new string[]
        {
            "신너굴 그가 정신을 차렸을땐\n태어나서 처음보는 아름다운 에메랄드빛의\n바다가 펼쳐져있었다.",
            "멀리로는 수평선과 \n하늘, 바다가 구분되지 않을만큼의\n선명하고 맑은 하늘이 투영되고있었다.",
            "대한민국에선 보기힘든 늪지대의 향연,\n유리같이 반짝이는 시멘트와 찰떡인\n거무죽죽한 버섯과 잡초들",
            "저멀리로 보이는 선명하고 푸르른 능선과\n사파이어 만큼 영롱한 물길이\n신너굴의 주위를 둘러싸고 있었다.",
            "태어나서 처음보는 광경에\n넋을 잃은것도 잠시\n신너굴은 정신을 차렸다.",
            "'하아.......\n내 너굴생이 어쩌다 이렇게 되버린거지???'"
        };

        BoolList bl = Comment.instance.CommentPrint(comments_a);

        yield return(new WaitUntil(() => bl.isDone));

        yield return(null);

        yield return(StartCoroutine(PLAYER_tr()));//플레이어가 움직이고나서 대화 출력

        string[] comments_b = new string[]
        {
            "'꾸륵꾸륵꾸륵'",
            "'정면에 보이는 바다의 물살이 갈라지며\n흡사 다시마가 승천하는듯한\n무언가가 솟아났다.'"
        };
        BoolList bl_b = Comment.instance.CommentPrint(comments_b);

        yield return(new WaitUntil(() => bl_b.isDone));

        yield return(StartCoroutine(DASHIDA()));

        string[] comments_c = new string[]
        {
            "\"신너굴님 맞으신가요 ??\"",
            "\"네에에???...제가 신너굴입니다만....\"",
            "\"아하! 안녕하세요\n저는 이섬의 관리를 맡고있는'다시다'입니다.",
            "궁금하신사항이나 필요하신게 있으시면\n해드릴진 모르겠지만 내키면 도와드릴게요~ \"",
            "'정말 다시다였구나.....'",
            "\"우선 빛을갚으려면 생존부터 해야겠죠?\n주변에있는 나뭇가지나 잡초들을 구해서 \n움막이라도 지어보세요\""
        };
        BoolList bl_c = Comment.instance.CommentPrint(comments_c);

        yield return(new WaitUntil(() => bl_c.isDone));


        StartCoroutine(FindObjectOfType <NPC_DASHIDA_TRIGGER>().DownDASHIDA());//다시다 내려감



        ctrl.transform.GetChild(0).GetComponent <Animator>().enabled = true;
        ctrl.enabled           = true;
        playerMovement.enabled = true;                                                                          //플레이어 동작가능

        JoyStickManager.Instance.CanvasAble();                                                                  //조이스틱 활성화
        QuestManager.instance.AddQuest("#생존을 위한 움막을 짓자1", "'나뭇가지 x5'\n'잡초 x10’", "", "Quest1", "QUESTONCLICK"); //퀘스트추가

        FindObjectOfType <NPC_DASHIDA>().AddObject("Quest1", "DASHI_A_start");                                  //다시다에게 퀘스트추가
        isClear = 10;
        PlayerPrefs.SetInt(saveStr, isClear);
    }