public void ShowLineWithCharacter(LineWithCharacter lineWithCharacter) { characterSprite.sprite = lineWithCharacter.characterSprite; characterName.GetComponent <TextMeshProUGUI>().text = lineWithCharacter.characterName; questionBox.SetActive(false); lineBox.GetComponent <TextMeshProUGUI>().text = lineWithCharacter.text; lineBox.SetActive(true); }
public void AdvanceDialogue() { if (index >= selectedConversation.elementsQueue.Length) { EndDialogue(); Debug.Log("Fin"); return; } if (selectedConversation.elementsQueue[index] is LineWithCharacter) { Debug.Log("J'affiche : " + index); waitForButton = false; LineWithCharacter toDisplay = selectedConversation.elementsQueue[index] as LineWithCharacter; Debug.Log(toDisplay); dialogueBox.GetComponent <DialogueUI>().ShowLineWithCharacter(toDisplay); index++; return; } if (selectedConversation.elementsQueue[index] is Line) { Debug.Log("J'affiche : " + index); waitForButton = false; Line toDisplay = selectedConversation.elementsQueue[index] as Line; Debug.Log(toDisplay); dialogueBox.GetComponent <DialogueUI>().ShowLine(toDisplay); index++; return; } if (selectedConversation.elementsQueue[index] is QuestionWithCharacter) { waitForButton = true; playerControls.UiControls.Disable(); QuestionWithCharacter toDisplay = selectedConversation.elementsQueue[index] as QuestionWithCharacter; dialogueBox.GetComponent <DialogueUI>().ShowQuestionWithCharacter(toDisplay); index++; return; } if (selectedConversation.elementsQueue[index] is Question) { waitForButton = true; Question toDisplay = selectedConversation.elementsQueue[index] as Question; playerControls.UiControls.Disable(); dialogueBox.GetComponent <DialogueUI>().ShowQuestion(toDisplay); index++; return; } }