(If you want to learn about the default typewriter instead, read here).
In order to create a custom typewriter for your game, you need to to create a custom class that inherits from TAnimPlayerBase
(Scripting API).
You have to override/implement the following methods.
It tells how much time to wait for each character. This way, you can implement your own special characters that need an unique wait time.
Example
protected override float GetWaitAppearanceTimeOf(char character)
{
switch (character)
{
case ',': return 0.3f;
case '!':
case '?':
case '.': return 0.6f;
}
return 0.1f;
}
Waits for input in order to continue showing text.
Example:
protected override IEnumerator WaitInput()
{
while (!Input.anyKeyDown)
yield return null;
}
You can also override the following methods for extra functionalities.
Override this method in case you want different disappearance wait times/speed. Otherwise, your custom textAnimatorPlayer will use the same delays as its typewriter (GetWaitAppearanceTimeOf);
Override this method to manage your custom actions. Read more here: Writing Custom Actions (C#))
Invoked every time the typewriter is starting to show the text. It doesn’t fire up if the typewriter is set to false.
✅ That’s it!
Have fun implementing your own players <3