Пример #1
0
    IEnumerator CountStart(int problemNum)
    {
        if (PhotonNetwork.IsMasterClient)
        {
            if (!inGameDialog.IsProblemComplete)
            {
                timer = 30;
            }

            while (!inGameDialog.IsProblemComplete)
            {
                yield return(null);
            }

            while (timer > 0)
            {
                yield return(null);

                timer -= Time.deltaTime;
                pv.RPC("RPC_Timer", RpcTarget.All, timer);
            }

            //결과 발표
            string result = quiz.GetAnswer(problemNum) ? "정답은 : O" : "정답은 : X";
            pv.RPC("RPC_ProblemPannel", RpcTarget.All, result);

            yield return(new WaitForSeconds(1.0f));

            StartCoroutine(objController.MoveMace(quiz.GetAnswer(problemNum)));


            yield return(new WaitForSeconds(5.0f));


            ProblemSelect();
        }
    }
Пример #2
0
    IEnumerator ProblemStart(float limitCount)
    {
        if (ListProblem.Count == Round)// || ListViewer.Count ==1)
        {
            Debug.Log("Game Over");
            yield break;
        }

        //문제 찾기
        int rndQuiz = 0;

        while (ListProblem.Count < Round)
        {
            rndQuiz = Random.Range(0, quiz.GetProblemCount());
            if (!ListProblem.Contains(rndQuiz))
            {
                //제출 하지 문제 선정
                ListProblem.Add(rndQuiz);
                break;
            }
        }

        //문제 제출시 이동 입력 허용
        UiPannel.GetComponent <TwitchPannel>().SetInfo("문제 : " + quiz.GetProblem(rndQuiz));
        twitchStream.isInputPossible = true;

        UiPannel.GetComponent <TwitchPannel>().txtInputInfo.gameObject.SetActive(true);

        while (!UiPannel.GetComponent <TwitchPannel>().isProblemTimeComplete)
        {
            yield return(null);
        }

        //카운트
        while (limitCount > 0)
        {
            limitCount -= Time.deltaTime;
            yield return(null);

            UiPannel.GetComponent <TwitchPannel>().SetCount(Convert.ToInt32(limitCount));
        }

        UiPannel.GetComponent <TwitchPannel>().txtInputInfo.gameObject.SetActive(false);
        //정답 발표 이동 입력 방지
        twitchStream.isInputPossible = false;
        bool   isTrue = quiz.GetAnswer(rndQuiz);
        string OX     = isTrue ? "O" : "X";

        UiPannel.GetComponent <TwitchPannel>().SetInfo("정답은 : " + OX);

        yield return(new WaitForSeconds(5.0f));

        //정답 발표 후 탈락저 처리


        MiddleObj.SetActive(false);
        if (isTrue)
        {
            XObj.SetActive(false);
        }
        else
        {
            OObj.SetActive(false);
        }


        yield return(new WaitForSeconds(5.0f));

        MiddleObj.SetActive(true);
        XObj.SetActive(true);
        OObj.SetActive(true);

        yield return(new WaitForSeconds(3.0f));

        //코르틴 재호출
        StartCoroutine(ProblemStart(15));
    }