using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; // change to "mission step" model in future [Serializable] public class DialogueStepModel { [SerializeField] // this flag tell whatewer dialoge ware already display to user public bool WasDisplayed = false; [SerializeField] // list to map to queue in DialogueController public List ListOfSentences = new List(); [SerializeField] public List Rewards; [SerializeField] public UnityEvent EndOfDialogueStepAction = new UnityEvent(); // for displaying set of sentences in one display public DialogueController DialogueController { get; protected set; } public DialogueStepModel() { } public DialogueStepModel(DialogueController _dialogueController) { DialogueController = _dialogueController; } /// /// Just convert list to queue structure :D /// public virtual void Build() { // 1. Clear previous setups // 2. Map first structur into second DialogueController = new DialogueController(); foreach (DialogueModel DialogueModel in ListOfSentences) { // Pass data to builded panel (name, sentence, buttons) DialogueController.AddSentence(DialogueModel); } // 3. Bind finishing action DialogueController.SetActionAfterDialogueEnds(EndOfDialogueStepAction); } }