示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (counter > sentences.Count && ended)
         {
             speech.StopRound();
             EndGame();
         }
         newSentence = !newSentence;
         speakNow.SetActive(!speakNow.activeSelf);
         if (counter == sentences.Count)
         {
             counter = 0;
             NewRound();
         }
         if (newSentence)
         {
             scores.StartScore();
             eb.ChangeTarget();
             currentSentence = sentences[counter];
             sentence.text   = currentSentence;
             if (speech != null)
             {
                 speech.StartRound(currentSentence);
                 mp.StartRecording();
             }
             counter++;
         }
         else
         {
             Debug.Log("hier");
             scores.StopScore();
             if (graph != null)
             {
                 graph.DrawGraph();
             }
             if (speech != null)
             {
                 speech.StopRound();
                 mp.StopRecording();
             }
         }
     }
 }