Global effects are shared and recognized between all TextAnimator instances, in all scenes.
They’re stored in a Scriptable Object named “
TextAnimator GlobalData”, inside a Resources folder.
(If your project doesn’t have a
Resources folder, simply create it).
You can create a
TextAnimator GlobalData Scriptable Object from the Project’s Context Menu (right click inside the project window).
After you’ve selected the effects container (TextAnimator component if you’re creating a local effect, the ScriptableObject if you’re creating a global one):
You can now edit the effect info and its different modules.
In the first section of the effect, you can find a text field where you can set the effectID (or effect tag).
👍🏻 If a local effect has the same tag (and type) of a global effect, the local effect will be applied.
After it, you can find a series of modules that control letters’ over time. To create your effect, you can enable one, multiple or all of them.
These modules control each letter movement, scaling or rotation.
You can tweak the following values:
Amplitude: represents the effect strength (it will also be multiplied by the curve intensity)
Chars Time Offset: distributes the effect along letters (0 = all letters will have the same time, so, the same effect strength at a given moment).
You can also use AnimationCurves value to control how the effect is applied over time. You can specify their duration, tangents and post-wrap behavior. Read more about Animation Curves in the Unity Documentation.
Curves’ intensity is applied differently depending on the type of effect you want to create.
For Behavior Effects:
Intensity over time: controls the effect intensity over time.
For Appearance Effects:
Decay over time: controls the effect’s decay over time. (So, the inverse of the Behaviors’ curve.)
Gradient: sets a color value in a specified percentage. (example: If you have a duration of 5, the color on second “2.5” must be set at a percentage of 50%.)
Duration: sets the module duration.
Chars Time Offset: same description/utility as above modules.
The following modules are present only if you’re creating Behavior effects.
Controls how the entire effect behaves during its lifetime (so, affecting all other modules).
Attack Curve: controls the effect intensity at start 👍🏻 If you want the effect to start immediately, you can set set all this curve’s keys’ time to 1. 👍🏻 If you want the effect to start after X seconds, move the first curve’s key’s position and make it start after X delay.
Continue Forever: true if you want the effect to continue forever after its start.
Decay Curve: controls the effect intensity in the end
Cycles: how many times the effect can loop (0 = infinitely, with the decay applied)
👍🏻 A total effect duraction is calculated from: attackCurveDuration + [max duration between all other modules] + decayCurveDuration.