// UpdatePromptRespGoTo updates the go-to value associated with the specified prompt's response value public void UpdatePromptRespGoTo(DialogPromptNode prompt, DialogResponse resp, string goToPrompt) { if (promptIds.Contains(prompt.GetNodeID())) { Debug.Log("updating prompt resp go to from " + resp.GetNext() + " to " + goToPrompt); prompt.SetRespNext(resp, goToPrompt); } }
// ChoseResponse is the listener to the button.onClick event, that is called // when a response button is chosen. This facilitates the next step towards // refreshing the screen to show the updated prompt & new responses public void ChoseResponse(DialogResponse resp) { this.AssignControllers(); currentTreeObj = dialogCtrl.GetDemoTree(); prompts = dialogCtrl.GetDemoTreePrompts(currentTreeObj); if (!string.IsNullOrEmpty(resp.GetNext())) { string goTo = resp.GetNext(); foreach (DialogPromptNode p in prompts) { if (p.GetNodeID() == goTo) { RefreshDisplay(p); break; } } } else { RefreshDisplay(null); } }