How to get the current subtitle Panels' gameObject directly

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
shortlin
Posts: 73
Joined: Wed Jun 03, 2020 1:52 am

How to get the current subtitle Panels' gameObject directly

Post 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...
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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);
Post Reply