private void GetCharacterInfo(GameObject character) { DialogeObject characterDialogue = character.GetComponentInChildren <DialogeObject>(); PanelName.GetComponentInChildren <TextMeshProUGUI>().text = characterDialogue.charName; portrait.sprite = characterDialogue.portrait; if (characterDialogue.CheckTheresOptions()) { textDialogue.text = character.GetComponentInChildren <DialogeObject>().GetMessage(); if (characterDialogue.CheckIsQuestion()) { foreach (string answer in characterDialogue.ReturnQuestions()) { //split de valor de respeto GameObject instancedAnswerObject = Instantiate(answerObject, PanelAnswers.transform) as GameObject; answerObject.GetComponent <AnswerObject>().Constructor(answer); } PanelAnswers.SetActive(true); } else { textDialogue.text = character.GetComponentInChildren <DialogeObject>().GetMessage(); } } ///Tomar panel del dialogo e ingresar a sus opciones que son rellenadas segĂșn el DialogueObject }
private void OnTriggerStay2D(Collider2D collision) { if (interacting) { if (Input.GetKeyDown(KeyCode.E) && keycodeCooldown && PanelDialogue.activeSelf) { dialogueObject = collision.GetComponentInChildren <DialogeObject>(); collision.GetComponentInChildren <DialogeObject>().IncreaseIndexMessage(); StartCoroutine(timerCooldown()); GetCharacterInfo(collision.gameObject); } } }