Esempio n. 1
0
 private void startStory(string story)
 {
     this.storyName = story;
     TextAsset[] textAssets = Resources.LoadAll <TextAsset>("SceneDescriptions/" + story);
     // Sort to ensure pages are in order.
     Array.Sort(textAssets, (f1, f2) => string.Compare(f1.name, f2.name));
     this.storyPages.Clear();
     // Figure out the orientation of this story and tell SceneDescription.
     this.setOrientation(this.orientations[this.storyName]);
     SceneDescription.SetOrientation(this.orientation);
     foreach (TextAsset text in textAssets)
     {
         this.storyPages.Add(new SceneDescription(text.text));
     }
     this.setOrientation(this.orientation);
     this.changeButtonText(this.nextButton, "Begin Story!");
     this.hideElement(this.backButton.gameObject);
     this.storyManager.LoadPage(this.storyPages[this.currentPageNumber]);
 }
Esempio n. 2
0
    private void startStory(string story)
    {
        this.storyName = story;
        DirectoryInfo dir = new DirectoryInfo(Application.dataPath +
                                              "/SceneDescriptions/" + story);

        FileInfo[] files = dir.GetFiles("*.json");
        // Sort to ensure pages are in order.
        Array.Sort(files, (f1, f2) => string.Compare(f1.Name, f2.Name));
        this.storyPages.Clear();
        // Figure out the orientation of this story and tell SceneDescription.
        this.setOrientation(this.orientations[this.storyName]);
        SceneDescription.SetOrientation(this.orientation);
        foreach (FileInfo file in files)
        {
            this.storyPages.Add(new SceneDescription(file.Name));
        }
        this.setOrientation(this.orientation);
        this.changeButtonText(this.nextButton, "Begin Story!");
        this.hideElement(this.backButton.gameObject);
        this.storyManager.LoadPage(this.storyPages[this.currentPageNumber]);
    }