Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: TokyoDan on November 17, 2014, 03:03:33 AM

Title: Is there a way to make a flashing UILabel?
Post by: TokyoDan on November 17, 2014, 03:03:33 AM
I want to make a message that flashes "Connecting..." when my game is accessing the internet. I want to do this with a UILabel. Is there an easy way to do this?
Title: Re: Is there a way to make a flashing UILabel?
Post by: ArenMook on November 17, 2014, 09:22:18 AM
  1. void Start() { StartCoroutine(FlashMyLabel()); }
  2.  
  3. IEnumerator FlashMyLabel()
  4. {
  5.     UILabel lbl = GetComponent<UILabel>();
  6.     for (;;)
  7.     {
  8.         lbl.enabled = !lbl.enabled;
  9.         yield return new WaitForSeconds(0.25f);
  10.     }
  11. }