Hey hello,
I am currently following the Unity Dialogue & Quest course, still a bit of a beginner. In the lecture you can open the dialog when pressing the mouse button. However am making a game on mobile and want to implement a UI Button where the player can click to talk on.
However I currently have not found a solution on how to implement the button to open the dialogue. The transparent white box is the button this is the code:
PlayerConversant playerConversant;
public bool OpenDialagueButton(PlayerController callingController)
{
dialogueButton.onClick.AddListener(() =>
{
callingController.GetComponent<PlayerConversant>().StartDialogue(dialogue);
});
return true;
}
PlayerConversant is from another file this is this code that needs to trigger:
public void StartDialogue(Dialogue newDialogue)
{
currentDialogue = newDialogue;
currentNode = currentDialogue.GetRootNode();
onConversationUpdated();
}