MayHeCome/Assets/Plugins/Febucci/Text Animator/Example/Scripts/Runtime/UsageExample.cs

30 lines
808 B
C#
Raw Normal View History

2024-12-18 09:55:34 +00:00
using UnityEngine;
namespace Febucci.UI.Examples
{
//Prevents this example to show up in the inspector, since it should be used only in the example scene (and so, not annoy you after you understand how this works)
[AddComponentMenu("")]
public class UsageExample : MonoBehaviour
{
public TypewriterByCharacter textAnimatorPlayer;
[TextArea(3, 50), SerializeField]
string textToShow = " ";
private void Awake()
{
UnityEngine.Assertions.Assert.IsNotNull(textAnimatorPlayer, $"Text Animator Player component is null in {gameObject.name}");
}
private void Start()
{
ShowText();
}
public void ShowText()
{
textAnimatorPlayer.ShowText(textToShow);
}
}
}