private string NextHint()
    {
        if (hintSentences == null)
        {
            hintSentences = hintConversation.GetConversation().ToList();
        }
        else if (hintSentences.Count == 0)
        {
            hintSentences = hintConversation.GetConversation().ToList();
        }

        int    r        = Random.Range(0, hintSentences.Count);
        string sentence = hintSentences[r];

        hintSentences.RemoveAt(r);
        return(sentence);
    }
Ejemplo n.º 2
0
    private void Talk()
    {
        if (currentConversationNumber == conversationPiece.currentConversation)
        {
            //nothing has changed
            if (currentSentences == null || currentSentences.Count == 0)
            {
                currentSentences = conversationPiece.GetConversation(currentConversationNumber).ToList <string>();
            }
        }
        else
        {
            //an event has happened that will change the bark set of the talker
            currentConversationNumber = conversationPiece.currentConversation;
            currentSentences          = conversationPiece.GetConversation(currentConversationNumber).ToList <string>();
        }


        if (sentenceFinished)
        {
            if (conversationPiece.inOrder)
            {
                currentSentence = PopNextSentence(currentSentences);
            }
            else
            {
                currentSentence = PopRandomSentence(currentSentences);
            }

            textBubble.Value.Type(conversationIcon.transform.position, currentSentence, SentenceFinished);
            sentenceFinished = false;
        }
        else
        {
            textBubble.Value.SkiptToTheEndOfCurrentSentence(currentSentence);
            sentenceFinished = true;
        }
    }