TextAnimator Fast Forward Script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
digiwombat
Posts: 50
Joined: Sun Jun 16, 2019 4:59 am

TextAnimator Fast Forward Script

Post by digiwombat »

Hello again.

TextAnimator skips to the next dialogue line when you click by default (which makes sense, since I believe the default FastForward only works for the default typewriter classes and things derived from it.)

I'm not sure if there's a package or script to handle it already that Tony has hidden somewhere, but hey, here's the TextAnimatorFastForward script I use to handle finishing the text appearance before going to the next dialogue:

Code: Select all

using Febucci.UI;
using UnityEngine;

namespace PixelCrushers.DialogueSystem.Wrappers
{
	public class TextAnimatorFastForward : PixelCrushers.DialogueSystem.StandardUIContinueButtonFastForward
	{
		public TextAnimator textAnimator;

		public override void OnFastForward()
		{
			if(!textAnimator.allLettersShown)
			{
				textAnimator.ShowAllCharacters(false);
			}
			else
			{
				base.OnFastForward();
			}
		}

	}

}
You may not need the namespace declaration and you can private/serializefield the textanimator, but I'm very lazy. Also, the tab size on the forum being 8 spaces wide is monstrous. Borderline criminal.

Enjoy.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: TextAnimator Fast Forward Script

Post by Tony Li »

The "Text Animator Support" package (see man page) has a TextAnimatorContinueButtonFastForward script and a few other goodies, too.

I'll make a note to look into tab spacing in phpBB -- hopefully before someone posts code that has a mix of spaces + tabs and their head explodes. :-)
Post Reply