示例#1
0
    public void StartSentences()
    {
        for (int i = 0; i < story.Length; i++)
        {
            story[i] = story[i].Replace("{", "<color=yellow>{");
            story[i] = story[i].Replace("}", "}</color>");
            story[i] = string.Format(story[i], selectedCandidates);
        }

        dudeController.StartCharacterTransformSequence();
        Sequence s = DOTween.Sequence();

        s.AppendInterval(dudeController.poseSwitchTime);
        s.AppendCallback(() => {
            string story = this.story[currentDisplayingStory];
            GameObject.Find("MadlibPanel").GetComponent <CanvasGroup>().alpha = 1.0f;
            GameObject.Find("DisplayTextUI").GetComponent <Text>().text       = story;

            bool isLong = false;
            if (story.Length >= 100)
            {
                isLong = true;
            }

            if (onSwitchSentence != null)
            {
                onSwitchSentence();
            }

            WaitAndDisplayNextSentence(isLong);
        });
    }