protected virtual void OnPopulateNarrative() { GameObject narrativeObject = GameObject.FindGameObjectWithTag("Narrative"); NarrativeStorage sceneStorage = narrativeObject.GetComponent <NarrativeStorage>(); sceneStorage.Initialize(); ((PopDialogue)target).PullNarrativePages(sceneStorage); ((PopDialogue)target).SyncByInspector(); EditorUtility.SetDirty(target); }
// Use this for initialization protected virtual void Start() { if (displayPages == null) { displayPages = new StoryChapter(); } if (linkNarrative && dialogueID != -1) { //Debug.Log("LinkNarrative now."); displayPages = new StoryChapter(); GameObject narrativeObject = GameObject.FindGameObjectWithTag("Narrative"); NarrativeStorage sceneStorage = narrativeObject.GetComponent <NarrativeStorage>(); //load the text from the story manager PullNarrativePages(sceneStorage); } transform.GetChild(0).gameObject.SetActive(false); }
public void PullNarrativePages(NarrativeStorage roomNarrative) { displayPages = new StoryChapter(); //Is this dialogue linked to the narrative? if (linkNarrative && roomNarrative != null) { //Debug.Log("narrative not null"); if (dialogueID != -1) { //Debug.Log("Find dialogue id: " + dialogueID.ToString()); //dialogueID is set, find the narrative chapter with the same dialogueID from StoryChapter findChapter = roomNarrative.FindChapter(dialogueID); if (findChapter != null) { //Debug.Log("Found Chapter"); displayPages = findChapter.GetClone(); } } } }