private void PlayStory() { story.SetActive(true); storyHead.SetActive(false); if (tweener != null) { tweener.Kill(true); } // end of all story head xml. if (storyItem == null) { LoadMainScene(); return; } storyText.text = string.Empty; tweener = storyText.DOText(storyItem.dialogue, 1); background.sprite = spriteMap[storyItem.bgFile]; storyItem = storyItem.nextStory; }
void Start() { story = transform.Find("Story").gameObject; storyText = transform.Find("Story/Text").GetComponent <Text>(); storyHead = transform.Find("StoryHead").gameObject; storyHeadText = transform.Find("StoryHead/Text").GetComponent <Text>(); background = GetComponent <Image>(); var clickButton = transform.Find("ClickButton").GetComponent <Button>(); clickButton.onClick.AddListener(PlayStory); var skipButton = transform.Find("SkipButton").GetComponent <Button>(); skipButton.onClick.AddListener(SkipStory); spriteMap = March.Core.ResourceManager.ResourceManager.instance.LoadAll <Sprite>(Configure.FilmBackgroundPath) .ToDictionary(v => v.name, v => v); qy.config.QuestItem quest = GameMainManager.Instance.playerData.GetQuest(); int chapter = quest != null?quest.chapter:1; storyItem = GameMainManager.Instance.configManager.StoryHeadConfig.GetFirstWithChapter(chapter); PlayStoryHead(); }
private void PlayStoryHead() { story.SetActive(false); storyHead.SetActive(true); storyHeadText.text = string.Empty; tweener = storyHeadText.DOText(storyItem.dialogue, 1.5f); storyItem = storyItem.nextStory; }
internal override void ReadItem(XmlElement item) { StoryHeadItem story = new StoryHeadItem(); story.id = item.GetAttribute("id"); story.bgFile = item.GetAttribute("bgFile"); story.dialogue = GetLanguage(item.GetAttribute("dialogue")); story.nextStoryId = item.GetAttribute("next"); story.personLocation = item.GetAttribute("personLocation"); dic.Add(story.id, story); }