private TextContainerWord[] SplitWordsAndLetters() { List <TextContainerWord> allWordsOfSentenses = new List <TextContainerWord>(); string[] localWords = textMesh.text.Trim().Split(' '); for (int i = 0; i < localWords.Length; i++) { string currentWord = localWords[i]; for (int j = 0; j < currentWord.Length; j++) { TextContainerWord tcw = new TextContainerWord(); tcw.text = currentWord[j].ToString(); if (j == currentWord.Length - 1) { tcw.isEndOfWord = true; } allWordsOfSentenses.Add(tcw); } } return(allWordsOfSentenses.ToArray()); }
private TextContainerWord[] SplitWords() { string[] wordsAsStrings = textMesh.text.Trim().Split(' '); TextContainerWord[] allWords = new TextContainerWord[wordsAsStrings.Length]; for (int i = 0; i < wordsAsStrings.Length; i++) { TextContainerWord tcw = new TextContainerWord(); tcw.text = wordsAsStrings[i]; allWords[i] = tcw; } return(allWords); }
public void AppendNextWord() { TextContainerWord nextWord = words[currentWordIndex]; if (hasSplitLetters) { textMesh.text += nextWord.text + (nextWord.isEndOfWord ? " " : ""); } else { textMesh.text += nextWord.text + " "; } currentWordIndex++; }