[unity] instructions for beginners of textanimator plug-in

C # Li natuo # C2022-06-23 18:09:19

Novice purchase and play TextAnimator I don't know how to start , I don't know where to start with the document ( Yes, I am ), Briefly introduce how to use , Not too strict instructions , If you have any questions, please correct .

1. Add the component
TMP Text File add components
Added TextAnimatorPlayer It will automatically add TextAnimator
 Insert picture description here
2.
Add the appropriate tag to the rich text

 Insert picture description here

 Insert picture description here
3. Control its display and closing by code

 /// <summary>
/// Show text
/// </summary>
/// <param name="_text">_text</param>
public static void ShowText(TMP_Text _text)
{
if (_text.GetComponent<TextAnimatorPlayer>() !=null)
{
TextAnimatorPlayer textAnimatorPlayer = _text.GetComponent<TextAnimatorPlayer>();
textAnimatorPlayer.StartShowingText(true);
}
else
{
Debug.LogError("TextAnimatorPlayer is NULL");
}
}
/// <summary>
/// The text disappears
/// </summary>
/// <param name="_text"></param>
public static void DisappearingText(TMP_Text _text)
{
if (_text.GetComponent<TextAnimatorPlayer>() != null)
{
TextAnimatorPlayer textAnimatorPlayer = _text.GetComponent<TextAnimatorPlayer>();
textAnimatorPlayer.StartDisappearingText();
}
else
{
Debug.LogError("TextAnimatorPlayer is NULL");
}
}

In this way, you can control its display and closing , The rest API The documents all contain , You can check it yourself


thank
Similar articles

2022-06-23