Writing Custom Actions C#
Last updated
Last updated
You're reading the documentation of an older/legacy version, Text Animator 1.X. To read the latest version, please visit this page instead . How to update:
You can create your own Custom Actions via script (C#).
(Do not forget to read here: Performing Actions While Typing )
In order to tell TextAnimator which tags are custom actions, you need to add them in the "Custom Actions" array (located in the TextAnimator's GlobalData Scriptable Object
asset).
P.S. In case you don't have a GlobalData Scriptable Object, please read here on how to create it.
In this example, I'm setting "playAudio" as a custom action.
Your Custom Actions can be performed by a custom typewriter:
Create a new typewriter class (Read more here).
Override the DoCustomAction
method (do not invoke the base method).
Perform specific actions based on the given "actionID
" and use any parameter
as you wish.
Add your new custom typewriter near a TextAnimator component, instead of the default "TextAnimatorPlayer".
Done! With this simple procedure, you can add any Custom Action you want.