public void ShowQuestionWithCharacter(QuestionWithCharacter question) { characterSprite.sprite = question.characterSprite; characterName.GetComponent <TextMeshProUGUI>().text = question.characterName; lineBox.SetActive(false); questionBox.SetActive(true); questionBox.GetComponent <QuestionUI>().Show(question); }
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; } }