Hi, Mr. Li!
I figured out that if you add a checkmark image to the Response button template, every button created gets it's own check mark. Is there a way to single out an individual response button in runtime and change its checkmark's active state?
Thank you very much for your help!
[Solved!] How to Manipulate Response Buttons
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
[Solved!] How to Manipulate Response Buttons
Last edited by CodePrincess on Wed Sep 04, 2019 9:28 pm, edited 1 time in total.
Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Re: How to Manipulate Response Buttons
Hi,
You can make a subclass of StandardDialogueUI and override the ShowResponses method as in this example:
Or you may find it simpler to add a script to the Dialogue Manager that has an OnConversationResponseMenu method:
You can make a subclass of StandardDialogueUI and override the ShowResponses method as in this example:
Code: Select all
public class MyDialogueUI : StandardDialogueUI
{
public override void ShowResponses(Subtitle subtitle, Response[] responses, float timeout)
{
// Set up the response buttons like
base.ShowResponses(subtitle, responses, timeout);
// Activate the first button's checkmark image:
var firstButton = conversationUIElements.defaultMenuPanel.instantiatedButtons[0];
firstButton.Find("Checkmark").SetActive(true);
}
}
Code: Select all
void OnConversationResponseMenu(Response[] responses)
{
StartCoroutine(DoSomethingAtEndOfFrame()); // Give dialogue UI until end of frame to set up menu buttons.
}
IEnumerator DoSomethingAtEndOfFrame()
{
// Activate the first button's checkmark image:
var dialogueUI = DialogueManager.dialogueUI as StandardDialogueUI;
var firstButton = dialogueUI.conversationUIElements.defaultMenuPanel.instantiatedButtons[0];
firstButton.Find("Checkmark").SetActive(true);
}
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
Re: How to Manipulate Response Buttons
Wow, you are so fast!
Thank you!

Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Re: How to Manipulate Response Buttons
Happy to help! 
