Triggering Events While Typing
Overview
Formatting
Listening to events
//Inside your script
public TextAnimator textAnimator;
//Manage the event subscription
private void Awake()
{
textAnimator.onEvent += OnEvent;
}
private void OnDestroy()
{
textAnimator.onEvent -= OnEvent;
}
//Do things based on messages
void OnEvent(string message)
{
switch (message)
{
case "something":
//do something
break;
}
}Last updated