示例#1
0
 IEnumerator Control(string s)
 {
     for (int i = 0; i < s.Length; i++)
     {
         char c = s[i];
         if (c == '[')
         {
             // StopCoroutine(coroutine);
             getJump(s.Substring(i));
             yield return(0);
         }
         else if (c == 'M')
         {
             string movement = s.Substring(i + 1, 2);
             if (movement == "03")
             {
                 eyesScript.BlinkEyes('.');
                 mouthScript.SayText('.');
             }
             bodyScript.Move(movement);
         }
         else if (c == '(' || c == ')' || c == '?')
         {
             eyesScript.BlinkEyes(c);
         }
         else if (c == '!')
         {
             ShowButtons();
         }
         else if (c == '#')
         {
             audioSource.clip = audioClips[step];
             audioSource.Play(0);
         }
         else
         {
             if (c == 'x')
             {
                 yield return(new WaitForSeconds(1f));
             }
             else if (!(c >= '0' && c <= '9'))
             {
                 mouthScript.SayText(c);
                 yield return(new WaitForSeconds(0.07f));
             }
         }
     }
 }