Пример #1
0
 public void TypeLetter(char letter)
 {
     Debug.Log("WHY");
     foreach (Word word in words)
     {
         //Debug.Log("whyme");
         if (word.WordTyped() == false)
         {
             if (word.GetNextLetter() == letter)
             {
                 //Debug.Log("Char");
                 word.TypeLetter();
                 if (word.WordTyped() == true)
                 {
                     //Debug.Log("somethingtobeyeeted");
                     deletable = true;
                     if (deleteme == null)
                     {
                         deleteme = word;
                         //Debug.Log("added");
                     }
                     else if (deleteme2 == null)
                     {
                         deleteme2 = word;
                     }
                     else if (deleteme3 == null)
                     {
                         deleteme3 = word;
                     }
                     else if (deleteme4 == null)
                     {
                         deleteme4 = word;
                     }
                 }
                 combocounter++;
             }
         }
     }
     if (deletable == true)
     {
         deleteme.display.RemoveWord();
         deleteme = null;
         if (deleteme2 != null)
         {
             deleteme2.display.RemoveWord();
             deleteme2 = null;
         }
         if (deleteme3 != null)
         {
             deleteme3.display.RemoveWord();
             deleteme3 = null;
         }
         if (deleteme4 != null)
         {
             deleteme4.display.RemoveWord();
             deleteme4 = null;
         }
         deletable = false;
     }
     Gamemanager.Combo(combocounter);
     for (int i = combocounter; i > 1; i--)
     {
         words[0].display.RemoveWord();
     }
     if (combocounter > 1)
     {
         StartCoroutine(cameras.Shake(.5f, .15f, combocounter));
         explosion.Play();
     }
     combocounter = 0;
 }