IEnumerator PrintTextAndSelectNextTextWhenDoneRoutine() { //Reet the last randomly selected text ResetCurrentTextMaxVisibleChar(); //Select a new randomly selected text SelectNextTextInList(); //Show the current text's via alpha ShowCurrentlySelectedTextViaAlpha(); int visibleCount = 0; int totalLength = selectedText.textInfo.characterCount; while (visibleCount <= totalLength) { isPrintingDone = false; selectedText.maxVisibleCharacters = visibleCount; visibleCount++; yield return(new WaitForSeconds(timeBetweenCharPrint)); } isPrintingDone = true; //Invoke FirstTextHasBeenPrinted after first selected text has finished printing if (textIndex == 1) { if (OnFirstTextHasBeenPrinted != null) { OnFirstTextHasBeenPrinted.Invoke(); } } yield break; }
void InvokeFirstTextHasBeenPrinted() { Debug.Log("INVOKEFIRSTTEXTHASbEENPRINTED"); OnFirstTextHasBeenPrinted.Invoke(); }
void InvokeFirstTextHasBeenPrinted() { OnFirstTextHasBeenPrinted.Invoke(); }