Esempio n. 1
0
    public void OnClickHandle()
    {
        if (isMoveing)
        {
            return;
        }
        if (DOTween.TotalPlayingTweens() > 0)
        {
            DOTween.CompleteAll();
            DOTween.KillAll();
            return;
        }

        qy.config.StoryItem story = curDialogue.next;
        if (story != null)
        {
            ShowStory(story);
        }
        else
        {
            qy.config.QuestItem nextQuest = qy.GameMainManager.Instance.playerData.GetQuest();
            if (nextQuest.type == qy.config.QuestItem.QuestType.Ending)
            {
                qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UIEndingWindow, nextQuest);
            }
            else
            {
                qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UITaskWindow, qy.GameMainManager.Instance.playerData);
            }
            qy.GameMainManager.Instance.weatherManager.StopAll();
            OnClickClose();
        }
    }
Esempio n. 2
0
        internal override void ReadItem(XmlElement item)
        {
            StoryItem story = new StoryItem();

            story.id             = item.GetAttribute("id");
            story.personLocation = item.GetAttribute("npcposition");
            story.personFile     = "";
            story.dialogue       = GetLanguage(item.GetAttribute("dialogue"));
            dic.Add(story.id, story);
        }
Esempio n. 3
0
        internal override void ReadItem(XmlElement item)
        {
            StoryItem story = new StoryItem();

            story.id             = item.GetAttribute("id");
            story.questId        = item.GetAttribute("questId");
            story.bgFile         = item.GetAttribute("bgFile");
            story.personFile     = item.GetAttribute("personFile");
            story.dialogue       = GetLanguage(item.GetAttribute("dialogue"));
            story.nextId         = item.GetAttribute("next");
            story.personLocation = item.GetAttribute("personLocation");
            string weather = item.GetAttribute("weather");

            story.weather = string.IsNullOrEmpty(weather) ? 0 : int.Parse(weather);
            story.effects = ReadEffects(item.GetAttribute("effect"));

            dic.Add(story.id, story);
        }
Esempio n. 4
0
    public void ShowStory(qy.config.StoryItem story)
    {
        gameObject.SetActive(true);
        lastDialogue = null;
        curDialogue  = null;
        dialogueBox.GetComponent <CanvasGroup>().alpha = 0;
        dialogueBox.gameObject.SetActive(false);
        personLeft.gameObject.SetActive(false);
        personRight.gameObject.SetActive(false);

        lastDialogue = curDialogue;
        curDialogue  = story;
        if (string.IsNullOrEmpty(curDialogue.personLocation))
        {
            curDialogue.personLocation = UnityEngine.Random.Range(0, 2).ToString();
        }

        string dialog     = curDialogue.dialogue;
        string personFile = lastDialogue == null || curDialogue.personFile != lastDialogue.personFile ? curDialogue.personFile : "";

        //如果这句对话和上句对话不是一个人说的则播放对话框动画
        ShowDialog(dialog, personFile, curDialogue.personLocation, lastDialogue == null || lastDialogue.personLocation != curDialogue.personLocation);
    }
Esempio n. 5
0
    public void OnClickHandle()
    {
        if (isMoveing)
        {
            return;
        }
        if (DOTween.TotalPlayingTweens() > 0)
        {
            List <Tween> tweens = DOTween.PlayingTweens();
            foreach (Tween t in tweens)
            {
                Debug.Log(t.target);
            }

            DOTween.CompleteAll();
            DOTween.KillAll();
            return;
        }
        if (onComplate != null)
        {
            Close();
            onComplate();
        }
        else
        {
            qy.config.StoryItem story = curDialogue.next;
            if (story != null)
            {
                ShowStory(story);
            }
            else
            {
                Close();
            }
        }
    }