Ejemplo n.º 1
0
        public void StoryDataLoadTest()
        {
            StoryData data = StoryData.CreateFromJSON("Intro");

            Assert.IsNotNull(data);
            Assert.IsTrue(data.story.Contains("Давным"));

            StoryData data1 = StoryData.CreateFromJSON("Ending");

            Assert.IsNotNull(data1);
            Assert.IsTrue(data1.story.Contains("Поздравляю"));
        }
Ejemplo n.º 2
0
    void Start()
    {
        string name = PlayerStats.LoadFromJson().name;

        isIntro   = SceneManager.GetActiveScene().name == "Beginning" ? true : false;
        storyText = GetComponentInChildren <Text>();
        if (isIntro)
        {
            data = StoryData.CreateFromJSON("I");
        }
        else
        {
            data = StoryData.CreateFromJSON("E");
        }
        data.story = data.story.Replace("{Имя главного героя}", name);
        sentences  = data.story.Split('|');
        StartCoroutine(PrintText());
        skipText.enabled = false;
    }