Page 1 of 1

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

Posted: Sun Jan 08, 2023 10:39 am
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!

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

Posted: Sun Jan 08, 2023 11:02 am
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();
}