Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Joyzh on June 18, 2015, 09:20:47 AM

Title: TypewriterEffect problem
Post by: Joyzh on June 18, 2015, 09:20:47 AM
public void ShowDownMessage(string txt){
      label.text = txt;
      label.GetComponent<TypewriterEffect>().ResetToBeginning();
}

//not show correctly
IEnumerator Start () {
      ShowDownMessage("");
      yield return new WaitForSeconds(3);
      ShowDownMessage("abc");
}

//show correctly
IEnumerator Start () {
                ShowDownMessage("123");
       yield return new WaitForSeconds(3);
      ShowDownMessage("abc");
}

It's weird that I can not clear label by set empty text on a TypewriterEffect label.
Can anyone help me solve this problem?

NGUI 3.9.0b
Title: Re: TypewriterEffect problem
Post by: ArenMook on June 21, 2015, 06:24:24 PM
Typewriter effect is supposed to work with text, but you aren't passing any. Why don't you simply set the text, and then if the string.isNullOrEmpty(label.text), then simply disable the TypewriterEffect instead of resetting it?