예제 #1
0
    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);
    }
예제 #2
0
    // 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);
    }
예제 #3
0
 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();
             }
         }
     }
 }