Page 1 of 1

Text Animator Continue Button Fast Forward

Posted: Sat Apr 25, 2020 8:36 am
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();
            }
        }
    }
}