Page 1 of 1

How to get the current subtitle Panels' gameObject directly

Posted: Wed Sep 16, 2020 8:37 am
by shortlin
Sorry Tony,I have a question again...

I want to use custom sequence Command to call current subtitle Panel's Object to call the Animator Component(I put it in the StandardUISubtitlePanel's portrait image) .

So I did not find a direct function to get the subtitle Panel object in the scene.

I know I can get the speaker and get the DialogueActor ,use SubTitlePanelNumber to know current's substilte panel's index.(Default is 0,Panel1 is 1, Panel2 is 2...Etc)

And then I could use "DialogueSystem.DisplaySettings.dialogueUI.GetComponent<StandardDialogueUI>().conversationUIElements.subtitlePanels[the panel's index]"

and use it to get StandardUISubtitlePanel's portrait image....

But.. It was so tired...I think there are some direct way to get this...

Re: How to get the current subtitle Panels' gameObject directly

Posted: Wed Sep 16, 2020 9:37 am
by Tony Li
Hi,

If you have a reference to the dialogue UI:

Code: Select all

StandardDialogueUI dialogueUI = DialogueManager.dialogueUI as StandardDialogueUI;
Then you can call GetPanel():

Code: Select all

Subtitle currentSubtitle = DialogueManager.currentConversationState.subtitle;
DialogueActor dialogueActor;
StandardUISubtitlePanel panel = dialogueUI.conversationUIElements.standardSubtitleControls.GetPanel(currentSubtitle, out dialogueActor);