Пример #1
0
    void Update()
    {
        if (m_GgState == GgState.PLAYING)
        {
            time -= Time.deltaTime;

            //if (min < 10)
            //{
            //    minString = "0" + Mathf.Floor(min).ToString();
            //}

            if (time > 0)
            {
                min = time / 60;
                sec = time % 60;

                if (sec < 10)
                {
                    secString = "0";
                }
                else
                {
                    secString = "";
                }
                timer.text = "0" + Mathf.Floor(min) + ":" + secString + Mathf.Floor(sec).ToString();
            }
            else
            {
                m_GgState = GgState.PAUSE;
                GameOver();
            }
        }
    }
Пример #2
0
 public void SetState(string state)
 {
     if (state == "PAUSE")
     {
         m_GgState = GgState.PAUSE;
     }
     if (state == "PLAYING")
     {
         m_GgState = GgState.PLAYING;
     }
 }
Пример #3
0
    public void Check()
    {
        if (InputText.text == answerStr[questionNum, nowLine])
        {
            //정답 사운드
            AudioSource.clip = correct;
            AudioSource.PlayOneShot(correct);
            nowLine += 1;
            if (nowLine == 4)
            {
                m_GgState = GgState.PAUSE;
                GameClear();
            }
            else
            {
                InputText.textComponent = texts[nowLine];
                InputText.text          = "";
                Debug.Log("일치!");


                Unity_Cunjiin_Keyboard.DisableCursors();
                Unity_Cunjiin_Keyboard.inputText   = for_Cursor[nowLine - 1].text;
                Unity_Cunjiin_Keyboard.underCursor = for_Cursor[nowLine - 1].under;
                Unity_Cunjiin_Keyboard.sideCursor  = for_Cursor[nowLine - 1].side;
                Unity_Cunjiin_Keyboard.Init_cursor();
            }
        }
        else
        {
            //오답 사운드
            AudioSource.clip = incorrect;
            AudioSource.PlayOneShot(incorrect);
            InputText.text = "";
            Debug.Log("틀렸어요");
            Debug.Log(questionNum);
            Debug.Log(answerStr[questionNum, nowLine]);
        }
    }
Пример #4
0
    void Start()
    {
        if (GameObject.FindGameObjectWithTag("GameManager") != null)
        {
            m_gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
            sceneData     = m_gameManager.GetSceneIndData(m_gameManager.GetGameMode());
        }
        clearCanvas.SetActive(false);

        nowLine = 0;

        questionNum = m_gameManager.GetGgamJiStageNum();
        Debug.Log(questionNum);
        answerSpace.text = "";
        for (int i = 0; i < 4; i++)
        {
            answerSpace.text += answerStr[questionNum, i] + "\n";
        }

        time      = 90f;
        m_GgState = GgState.PAUSE;
        startEndAni.SetTrigger("tutoOff");
    }