Page 1 of 1

TextAnimator Fast Forward Script

Posted: Tue Dec 06, 2022 8:30 pm
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.

Re: TextAnimator Fast Forward Script

Posted: Wed Dec 07, 2022 9:13 am
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. :-)