Hi Tony,
Just wondering if you have an easy way to return all the response buttons which appear during a conversation?
Eg: A conversation starts with one response button for the user (so I would like to return that one button/button name), but the next response in the conversation gives the player two response buttons to select from. How would I be able to return the choice of buttons/button names via code?
I know how to find the current selected button via EventSystem + UnityEngine.UI - but would be nice to be able to return the buttons dynamically as they appear in the conversation.
I'll keep trying to figure it out myself, but any help would be amazing.
Thanks mate
Return All Active Buttons During Dialogue
Re: Return All Active Buttons During Dialogue
All good, found a way
Re: Return All Active Buttons During Dialogue
[Edit: Our posts crossed. ]
Just before the Dialogue System shows a response menu, it calls the OnConversationResponseMenu(Response[]) method on any scripts that have that method, on the Dialogue Manager GameObject and the two primary participants' GameObjects (e.g., the Dialogue System Trigger's Conversation Actor and Conversation Conversant). Example:
Just before the Dialogue System shows a response menu, it calls the OnConversationResponseMenu(Response[]) method on any scripts that have that method, on the Dialogue Manager GameObject and the two primary participants' GameObjects (e.g., the Dialogue System Trigger's Conversation Actor and Conversation Conversant). Example:
Code: Select all
void OnConversationResponseMenu(Response[] responses)
{
Debug.Log("About to show a response menu containing:");
foreach (Response response in responses)
{
Debug.Log(response.formattedText.text);
}
}