Example #1
0
 public void newPlayerMessage()
 {
     if (currentMessage != null && aiMessagePrefab != null && currentMessage.playerAnswers.Length != 0)
     {
         playerAnswerPrefab.GetComponentInChildren <TextMeshProUGUI>().text = currentMessage.playerAnswers[optionChosenValue].answer;
         playerMes = Instantiate(playerAnswerPrefab);
         playerMes.transform.SetParent(messagePlaceHolder.transform);
         currentMessage = currentMessage.playerAnswers[optionChosenValue].aiMessage;
         autoScroll.SetAutoScroll();
         currentMessageSent = false;
         CheckConversationType();
     }
 }
 public void OpenConversation()
 {
     Debug.Log("mensaje a mandar: " + currentMessage.messageText);
     if (currentMessage != null && !aItalking)
     {
         SendMessage();
     }
     else if (aItalking && !currentMessageSent)
     {
         Destroy(aiMes);
         SendMessage();
     }
     else if (currentMessage == null)
     {
         dropdown.ClearOptions();
     }
     if (conversationPanel.activeInHierarchy)
     {
         autoScroll.SetAutoScroll();
     }
 }