/// <summary> /// Shows the dialogue UI with the current dialogue line /// </summary> /// <param name="line">Curremt line that shoudl be displayed</param> void ShowDialogue(DialogueObject line) { //Debug.Log("Show dialogue"); dialogueCanvas.SetActive(true); dialogueInputField.gameObject.SetActive(false); speakerNameText.text = line.speakerName; dialogueText.text = line.dialogueLine; switch (line.dialogueType) { case (DialogueType.BasicLine): if (line.basicLineCall != null) { line.basicLineCall(); } break; case DialogueType.TextInput: dialogueInputField.gameObject.SetActive(true); dialogueInputField.contentType = line.inputContentType; dialogueInputField.characterLimit = line.maxInputLength; dialogueInputField.text = ""; dialogueInputField.placeholder.GetComponent <Text>().text = line.inputPlaceholderText; dialogueInputField.Select(); break; default: Debug.LogError("Error unknown DialogueType " + line.dialogueType); break; } }