Continue button - playing sound & finishing audio at the true end

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JasonDev
Posts: 4
Joined: Sun Dec 25, 2022 1:23 pm

Continue button - playing sound & finishing audio at the true end

Post by JasonDev »

Hey there,

So I I've set the continue button to always in the Dialog Manager UI.
When we click it, if the chat typewriter is not finish showing we will show the finished chat and we need to click it again before we continue to the next chat.

So there is two problems whenever this occur

1. Continue button stops the player's audio. I'm fine with it stopping the audio when the true continue button is clicked and it moves to the next chat, but not in the case above.
2. Where do we add events to play audio (or sequence to play audio is also okay) when true continue button is clicked?? Because if I do even, the audio is played twice in the case abvoe!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue button - playing sound & finishing audio at the true end

Post by Tony Li »

Hi,

Add a StandardUIContinueButtonFastForward component to your continue button, and configure the Button component's OnClick() event to call StandardUIContinueButtonFastForward.OnFastForward. Also assign the subtitle text to the StandardUIContinueButtonFastForward. For examples, see the dialogue UI video tutorials or any of the dialogue UI prefabs that ship with the Dialogue System. They all use StandardUIContinueButtonFastForward.

To add audio when the player advances the conversation using the button, use a subclass of StandardUIContinueButtonFastForward instead of StandardUIContinueButtonFastForward itself. Override the OnFastForward method to do something like:

Code: Select all

public override void OnFastForward()
{
    if (typewriterEffect == null || !typewriterEffect.isPlaying)
    {
        // play your audio here
    }
    base.OnFastForward();
}
Post Reply