Page 2 of 2
Re: OnContinue once makes all subtitles play superfast
Posted: Mon Feb 01, 2021 11:02 am
by nicmar
Great, thanks I'll try that!
Re: OnContinue once makes all subtitles play superfast
Posted: Mon Feb 01, 2021 2:27 pm
by nicmar
Thanks, but the problem here is that I need to run the custom close function of the current open subtitle, which has dotween.
Is there any way to get a reference to the current subtitle, or should I use events to broadcast to all subtitles?
Re: OnContinue once makes all subtitles play superfast
Posted: Mon Feb 01, 2021 4:38 pm
by Tony Li
nicmar wrote: ↑Mon Feb 01, 2021 2:27 pmIs there any way to get a reference to the current subtitle[?]
Yes:
Code: Select all
Subtitle currentSubtitle = DialogueManager.currentConversationState.subtitle;
StandardDialogueUI ui = DialogueManager.dialogueUI as StandardDialogueUI;
DialogueActor currentDialogueActor;
StandardUISubtitlePanel currentPanel = ui.conversationUIElements.standardSubtitleControls.GetPanel(currentSubtitle, out currentDialogueActor);
Debug.Log("Current subtitle panel is: " + currentPanel);
Re: OnContinue once makes all subtitles play superfast
Posted: Mon Feb 01, 2021 4:58 pm
by nicmar
Brilliant, it worked perfectly! Sorry if I asked this question before, when I read the code I recognize it..
Now i just need to figure out how to show/hide the full screen skip button, but I think I have everything i need to do that. Thanks again Tony, you're the best!
Re: OnContinue once makes all subtitles play superfast
Posted: Mon Feb 01, 2021 5:12 pm
by Tony Li
Glad to help!
Can you show/hide it using the dialogue UI's Dialogue Panel > OnOpen() and OnClose() events?
If not, perhaps you can use the OnConversationStart and OnConversationEnd
script messages or equivalent UnityEvents on the
Dialogue System Events component.
Re: OnContinue once makes all subtitles play superfast
Posted: Tue Feb 02, 2021 5:52 am
by nicmar
I made it using a combination of those, and now it works great! Thanks again
Re: OnContinue once makes all subtitles play superfast
Posted: Tue Feb 02, 2021 9:09 am
by Tony Li
Happy to help!