Author Topic: Typewriter Effect OnFinish problem  (Read 5683 times)

WinWin123

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Typewriter Effect OnFinish problem
« on: December 29, 2015, 11:00:33 PM »
Hello, in the Update function of the TypewriterEffect.cs
void Update ()
   {
                .............Other codes

      // Alpha-based fading
      if (mCurrentOffset >= mFullText.Length)
      {
         mLabel.text = mFullText;
      }
      else if (mFade.size != 0)
      {
         //..........Other codes
      }
      else if (mCurrentOffset >= mFullText.Length)
      {
         current = this;
         EventDelegate.Execute(onFinished);
         current = null;
         mActive = false;
      }
   }

The first if condition is the same as the last else if condition (mCurrentOffset >= mFullText.Length)
So basically it will never enter the last else if block and execute the onFinish function?
( I have changed the last "else if" to "if" for now )
Thanks~

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Typewriter Effect OnFinish problem
« Reply #1 on: December 30, 2015, 02:55:51 AM »
You need to update your NGUI...

WinWin123

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Typewriter Effect OnFinish problem
« Reply #2 on: December 30, 2015, 06:07:13 AM »
Oh thanks a lot ><