Text Animator Continue Button Fast Forward

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Text Animator Continue Button Fast Forward

Post by Tony Li »

To use a continue button with Text Animator's typewriter effect, replace the button's StandardUIContinueButtonFastForward component with the script below, and hook up the button's OnClick() event to its OnFastForward method. Make sure to assign the Text Animator Player, too.

TextAnimatorContinueButtonFastForward.cs

Code: Select all

namespace PixelCrushers.DialogueSystem
{
    /// <summary>
    /// This is a subclass of StandardUIContinueButtonFastForward for Text Animator subtitles.
    /// </summary>
    public class TextAnimatorContinueButtonFastForward : StandardUIContinueButtonFastForward
    {
        public Febucci.UI.TextAnimatorPlayer textAnimatorPlayer;

        public override void OnFastForward()
        {
            if (!textAnimatorPlayer.textAnimator.allLettersShown)
            {
                textAnimatorPlayer.SkipTypewriter();
            }
            else
            {
                base.OnFastForward();
            }
        }
    }
}
Post Reply