As you might have noticed, I'm making animations with DoTween when opening and closing subtitles.
However I've stumbled upon the issue that when I select a response from a StandardUIMenuPanel (which now I use as CustomUIMenuPanel as a subclass), the HideResponses() call is run, then the gameobject is disabled.
I tried overriding HideResponses() to play my animation, then use base.HideResponses(), but it still closes the window.
So I suspect something else higher up in the system closes it. Do you know what that could be and have a possible solution for me?
Animation when selecting from response menu
Animation when selecting from response menu
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Re: Animation when selecting from response menu
Make a subclass of StandardDialogueUI (if you haven't already). Override ShowSubtitle. The original method is:
The first thing it does when showing a subtitle is to tell all menu panels to close, in case they aren't already closed. If you know the menu panel will be closed, in your version you can get rid of that line:
Code: Select all
public override void ShowSubtitle(Subtitle subtitle)
{
conversationUIElements.standardMenuControls.Close();
conversationUIElements.standardSubtitleControls.ShowSubtitle(subtitle);
}
Code: Select all
public override void ShowSubtitle(Subtitle subtitle)
{
conversationUIElements.standardSubtitleControls.ShowSubtitle(subtitle);
}
Re: Animation when selecting from response menu
Great, it almost worked!
My animation plays, but it starts showing the next subtitle right away.
Where do I intervene with that, so I can manually advance to the next subtitle when my animation has finished playing?
My animation plays, but it starts showing the next subtitle right away.
Where do I intervene with that, so I can manually advance to the next subtitle when my animation has finished playing?
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Re: Animation when selecting from response menu
In the same overridden ShowSubtitle, start a coroutine. Maybe something like:
Code: Select all
public override void ShowSubtitle(Subtitle subtitle)
{
StartCoroutine(ShowSubtitleAfterMenuCloses(subtitle));
}
IEnumerator ShowSubtitleAfterMenuCloses(Subtitle subtitle)
{
float timeout = Time.time + 5f; // Time out after 5 seconds in case menu never closes for some reason.
// NOTE: You may need to change the while() condition below for your needs:
while (conversationUIElements.defaultMenuPanel.isOpen && Time.time < timeout)
{
yield return null;
}
conversationUIElements.standardSubtitleControls.ShowSubtitle(subtitle);
}