public void CanChangeSentenceAgain(bool state) //Starting The SentenceChange Again { if (state == false) { CanSentenceChangeAtEnd = false; } else { CanSentenceChangeAtEnd = true; if (_WordIndex >= _AllSentences [0].Count) { _WordIndex = 0; _AllSentences.RemoveAt(0); _AllSentences.Add(new List <string> (AllOurWords.Sentences())); _TypedLetters = ""; SentenceUpdate(); //Color Update } } }
void Start() { for (int i = 0; i < SentencesToHave; i++) { _AllSentences.Add(new List <string>(AllOurWords.Sentences())); } TheSentence = ""; for (int i = 0; i < _AllSentences[0].Count; i++) { TheSentence += _AllSentences[0][i] + " "; } SentenceTextBox.text = TheSentence; TheSentence = ""; for (int i = 0; i < _AllSentences[1].Count; i++) { TheSentence += _AllSentences[1][i] + " "; } SentenceTextBox2.text = TheSentence; }
void SentenceCheck() { _StoredPoints = 0; while (true) { if (_WordIndex < _AllSentences [0].Count) { _CheckWord = _AllSentences [0] [_WordIndex]; //Sentence Word _CheckWordLength = _CheckWord.Length; //CurrentTypedWord if (_TypedLetters.Length >= _CheckWordLength) { for (int j = 0; j < _CheckWordLength; j++) //Checking If Words Are The Same { if (_TypedLetters [j] != _CheckWord [j]) { if (CanGetPointsAfterCorrectWord == true) { ThePlayerAttack.DmgGained(_StoredPoints); //Adding Dmg To The DmgCharger } return; } } } else { if (CanGetPointsAfterCorrectWord == true) { ThePlayerAttack.DmgGained(_StoredPoints); //Adding Dmg To The DmgCharger } // WordCombo -= 0.01f;//Used Space While Nothing Complete, Results In A Penalty return; } // WordCombo += 0.01f;//Adding Combo Points _StoredPoints += Mathf.FloorToInt((_CheckWordLength * LetterBonusMultiplyer) /* * WordCombo*/); //Combo Is A % Increase To Points _TypedLetters = _TypedLetters.Remove(0, _CheckWordLength); //Removing Complete Word.length from the string if (_WordIndex + 1 < _AllSentences [0].Count) { _WordIndex++; } else { if (CanSentenceChangeAtEnd == true) { _WordIndex = 0; _AllSentences.RemoveAt(0); _AllSentences.Add(new List <string> (AllOurWords.Sentences())); _TypedLetters = ""; } else { _WordIndex = _AllSentences [0].Count; } if (_StoredPoints > 0) { if (CanGetPointsAfterCorrectWord == true) { ThePlayerAttack.DmgGained(_StoredPoints); //Adding Dmg To The DmgCharger } } return; } if (_TypedLetters.Length > 0) { if (!_TypedLetters [0].Equals(' ')) //If Next Letter Isnt Space. Then There Is No Next Word, Cuz There Is Always Space Between { _TypedLetters = ""; if (CanGetPointsAfterCorrectWord == true) { ThePlayerAttack.DmgGained(_StoredPoints); //Adding Dmg To The DmgCharger } return; } else { _TypedLetters = _TypedLetters.Remove(0, 1); //Removing Space } } } else { return; } } }