I am trying to use questmachine for my game. However i want to trigger the dialogue at certain points in the game via code to continue with the story while the player runs around.
However, i am facing problems trying to open and update the dialogue UI via code.
i am using custom srt files to have the text updated and synced with the voice over.
For that i am sending a message with the srt file as parameter instead of using the dialogue box.
Now i am facing these problems:
1. The text in the dialogueui is not updated using:
Code: Select all
_dialogueUI.bodyTemplate.Assign(srtFileContent);
Code: Select all
_currentSpeaker.StartDialogue(QuestManager.instance.gameObject);
Code: Select all
public void OnGreetMessageSend(MessageArgs messageArgs)
{
_currentSpeaker = QuestMachineMessages.FindGameObjectWithID(messageArgs.sender.ToString()).GetComponent<QuestGiver>();
//todo not working for some reason:
//_currentSpeaker.StartDialogue(QuestManager.instance.gameObject);
_dialogueUI.Show();
ProcessSRTFile(messageArgs.parameter);
}
private void ProcessSRTFile(string srtFileContent)
{
_dialogueUI.bodyTemplate.Assign(srtFileContent);
_dialogueUI.Hide();
}