void Awake()
    {
        // find the script and allow me to check for collision
        //zone = GameObject.Find("InteractionZone").GetComponent<ZoneCheck>();
        zone            = gameObject.transform.GetChild(0).GetComponent <ZoneCheck>();
        playerAttention = false;
        isMatched       = false;
        inMatchList     = false;

        if (likesPudding)
        {
            attribute += "Likes Pudding";
        }
        else
        {
            attribute += "Hates Pudding";
        }

        if (likesVideoGames)
        {
            attribute += ", Likes Video Games";
        }
        else
        {
            attribute += ", Hates Video Games";
        }

        convo = new ConversationPoint("Hey! I'm " + name + "!\nHere's some facts about me:\n" + attribute,
                                      new ResponseTree {
            { "Cool story bro", new ConversationPoint("Press F to add me to the match list!") }
        }
                                      );

        convoManager = GameObject.Find("Conversation Manager").GetComponent <ConversationManager>();
    }
Beispiel #2
0
 void PopulateExampleConvo()
 {
     conversationTree = new ConversationPoint(
         "Is my electron kawaiiiiii~~~~~",
         new ResponseTree {
         { "Of course!", new ConversationPoint("Yay!") },
         { "...no.", new ConversationPoint("Aww. You're mean.") }
     });
 }
Beispiel #3
0
 /// <summary>
 /// Get the next conversation point based off of the given response.
 /// </summary>
 /// <param name="response"></param>
 /// <param name="nextPoint"></param>
 /// <returns>True if it was found successfully, false if not.</returns>
 public bool getNextPointFromResponse(string response, out ConversationPoint nextPoint)
 {
     if (optionTree != null)
     {
         return(optionTree.TryGetValue(response, out nextPoint));
     }
     else
     {
         nextPoint = null;
         return(false);
     }
 }
Beispiel #4
0
    public void ChoiceSelected(string choice)
    {
        ConversationPoint next;
        var found = conversationTree.getNextPointFromResponse(choice, out next);

        if (found)
        {
            conversationTree = next;
            box.Active       = false;
            setUI(next);
            box.Active = true;
        }
        else
        {
            box.Active = false;
        }
    }
Beispiel #5
0
    void setUI(ConversationPoint newPoint)
    {
        conversationTree.onClosedText.Invoke();

        box.Text = newPoint.ToString();

        conversationTree.onPresentText.Invoke();

        clearDialogChildren();

        if (!newPoint.isLastWord)
        {
            foreach (var choice in newPoint.optionTree.Keys)
            {
                var button = Instantiate(choiceButtonProto) as ResponseButton;
                button.Response = choice;
                button.Manager  = this;

                button.gameObject.transform.SetParent(buttonMenu, false);
            }
        }
    }