public void SwitchDialogues(LoopDialogue newDialogue) { myDialogue = newDialogue; if (myDialogue != null) { myDialogue = ScriptableObject.Instantiate(myDialogue); dialogueMap.Clear(); foreach (var dobj in myDialogue.content) { dialogueMap.Add(dobj.loop, dobj); } } }
// EXECUTION FUNCTIONS private void Awake() { myText = GetComponent <Text>(); animator = GetComponent <Animator>(); gameObject.SetActive(false); if (myDialogue != null) { myDialogue = ScriptableObject.Instantiate(myDialogue); foreach (var dobj in myDialogue.content) { dialogueMap.Add(dobj.loop, dobj); } } }