[SOLVED] Check if subtitles are fully displayed in Custom Sequencer Script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Sindaru
Posts: 4
Joined: Wed Mar 16, 2016 1:42 pm
Contact:

[SOLVED] Check if subtitles are fully displayed in Custom Sequencer Script

Post by Sindaru »

Hello again.

Similar to the problem I encountered in this thread I now am wondering how to check in code if the subtitles that are displayed with a typewriter effect are done writing up (so they are fully displayed). My plan is to have an animator bool controlling a talk-loop set from true to false depending on whether the typewriter effect is currently active (or aborted by the player). The check is aimed to naturally occur in the update loop.
Last edited by Sindaru on Thu Mar 24, 2016 8:26 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Check if subtitles are fully displayed in Custom Sequencer Script

Post by Tony Li »

Hi,

The UnityUITypewriterEffect script has three events: OnBegin, OnCharacter, and OnEnd. You can assign a method to OnEnd to be notified when the effect is finished typing.

For your use case, you could set an animator bool with OnBegin and clear it with OnEnd.
User avatar
Sindaru
Posts: 4
Joined: Wed Mar 16, 2016 1:42 pm
Contact:

Re: Check if subtitles are fully displayed in Custom Sequencer Script

Post by Sindaru »

Hey Tony,

thanks for showing me that gem - that solved it. I should spend some more time digging into the inner workings of the dialogue system next time. :)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED] Check if subtitles are fully displayed in Custom Sequencer Script

Post by Tony Li »

Don't hesitate to ask any questions right away. If I can save you some time with a quick answer, I'm happy to do so.
Post Reply