@Message(Typed) using Text Animator

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Keiji
Posts: 17
Joined: Tue Feb 18, 2020 2:29 pm

@Message(Typed) using Text Animator

Post by Keiji »

Hi Tony!

I just integrated Febucci's Text Animator into the Dialogue System UI I am using. So far it all worked perfectly, the effects and typewriter and click to skip all work. However, I noticed that the @Message(Typed) sequencer commands seem not to work anymore.

I may be doing something wrong. Can I not use those when I use the Text Animator Typewriter instead of the Unity one? Is there a workaround for this? I use AnimatorPlay(Idle)@Message(Typed); to trigger the idle state in my NPCs after they have talked their lines.

Wishing all the best,

Keiji
User avatar
Tony Li
Posts: 22005
Joined: Thu Jul 18, 2013 1:27 pm

Re: @Message(Typed) using Text Animator

Post by Tony Li »

Hi,

Since Text Animator does its own typewriting, it doesn't use the Dialogue System's typewriter effect that sends the "Typed" message.

Add this script to the same GameObject as the Text Animator Player:

TextAnimatorSendTyped.cs

Code: Select all

using UnityEngine;
using Febucci.UI;
using PixelCrushers.DialogueSystem;
[RequireComponent(typeof(TextAnimatorPlayer))]
public class TextAnimatorSendTyped : MonoBehaviour
{
    void Start()
    {
        GetComponent<TextAnimatorPlayer>().onTextShowed.AddListener(() => { Sequencer.Message("Typed"); });
    }
}
Keiji
Posts: 17
Joined: Tue Feb 18, 2020 2:29 pm

Re: @Message(Typed) using Text Animator

Post by Keiji »

Hey Tony! Sorry about the late reply! I redid the Dialogue UI and added your script as you suggested. Everything works perfectly again! Thanks a lot :D

Keiji
User avatar
Tony Li
Posts: 22005
Joined: Thu Jul 18, 2013 1:27 pm

Re: @Message(Typed) using Text Animator

Post by Tony Li »

Great! Thanks for letting me know.
Post Reply