Example #1
0
 public void AssignOwner(FBasic_Conversation conversation)
 {
     OwnerConversation = conversation;
     for (int i = 0; i < Replys.Count; i++)
     {
         Replys[i].AssignOwner(this);
     }
 }
        void Start()
        {
            if (TargetConversation == null)
            {
                TargetConversation = GetComponent <FBasic_Conversation>();
            }

            if (Replys.Count != PlayerReply.Count)
            {
                Debug.LogError("Wrong reply count in order to 'PlayerReply' actor ids' count");
                Destroy(this);
                return;
            }

            FBasic_DialogueBase targetDialogue = new FBasic_DialogueBase(DialogueTitle);

            targetDialogue.Replys = new List <FBasic_ReplyBase>();

            for (int i = 0; i < Replys.Count; i++)
            {
                FBasic_ReplyBase reply = new FBasic_ReplyBase();
                reply.Text = Replys[i];

                if (PlayerReply[i] == true)
                {
                    reply.TalkActor = FBasic_ReplyBase.FReplyTalker.Player;
                }
                else
                {
                    reply.TalkActor = FBasic_ReplyBase.FReplyTalker.NPC;
                }

                targetDialogue.AddReply(reply);
            }

            if (EndingDialogue)
            {
                targetDialogue.Replys[targetDialogue.Replys.Count - 1].EndConversation = true;
            }

            if (StarterDialogue)
            {
                TargetConversation.StarterDialogue = targetDialogue;
            }
            else
            {
                TargetConversation.AddDialogue(targetDialogue);
            }
        }
 private void Reset()
 {
     TargetConversation = GetComponent <FBasic_Conversation>();
 }