/// <summary> /// Adding dialogue to available dialogue options list /// </summary> internal void AddDialogue(FBasic_DialogueBase targetDialogue) { if (AvailableDialogues == null) { AvailableDialogues = new List <FBasic_DialogueBase>(); } if (!AvailableDialogues.Contains(targetDialogue)) { AvailableDialogues.Insert(0, targetDialogue); } }
/// <summary> /// Starting choosed dialogue to progress /// </summary> protected virtual void StartDialogue(FBasic_DialogueBase dial) { ActiveDialogue = dial; dial.AssignOwner(this); dial.OnDialogueStart(); ActiveReplyIndex = 0; ActiveReply = ActiveDialogue.Replys[ActiveReplyIndex]; hidingReply = false; ShowReply(); }
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); } }
/// <summary> /// Making link to owner dialogue class /// </summary> public void AssignOwner(FBasic_DialogueBase dialogue) { OwnerDialogue = dialogue; }