コード例 #1
0
    private void Next()
    {
        if (tp == Talking_person.LEFT)
        {
            Animator Ani = leftBtn.GetComponent <Animator>();
            Ani.SetTrigger("small");
            Animator Ani2 = rightBtn.GetComponent <Animator>();
            Ani2.SetTrigger("big");

            dia_count = (dia_count + 1) % dialogs.Count;
            tp        = Talking_person.RIGHT;
            if (dialogs[dia_count].Length > 12)
            {
                rightText.text = dialogs[dia_count].Substring(0, 12);
                for (int i = 0; i < dialogs[dia_count].Length - 12; i++)
                {
                    dia.Add(dialogs[dia_count].Substring(i + 1, 12));
                }
                StartCoroutine(BubbleOut());
            }
            else
            {
                rightText.text = dialogs[dia_count];
            }
        }
        else
        {
            Animator Ani = rightBtn.GetComponent <Animator>();
            Ani.SetTrigger("small");
            Animator Ani2 = leftBtn.GetComponent <Animator>();
            Ani2.SetTrigger("big");

            dia_count = (dia_count + 1) % dialogs.Count;
            tp        = Talking_person.LEFT;
            if (dialogs[dia_count].Length > 12)
            {
                leftText.text = dialogs[dia_count].Substring(0, 12);
                for (int i = 0; i < dialogs[dia_count].Length - 12; i++)
                {
                    dia.Add(dialogs[dia_count].Substring(i + 1, 12));
                }
                StartCoroutine(BubbleOut());
            }
            else
            {
                leftText.text = dialogs[dia_count];
            }
        }
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        dialogs = new List <string>();
        dialogs.Clear();
        dialogs.Add("既然我回来了,就把你们安排得明明白白的");
        dialogs.Add("你为什么不放大");
        dialogs.Add("下路一直叫我去我怎么去啊,对面酒桶一直进我野区");
        dialogs.Add("这个人思想出了问题");


        Animator Ani = leftBtn.GetComponent <Animator>();

        Ani.SetTrigger("big");

        leftBtn.gameObject.transform.localScale = new Vector3(0, 0, 0);
        Debug.Log(dialogs[0]);
        dia_count = 0;
        if (dialogs[dia_count].Length > 12)
        {
            leftText.text = dialogs[dia_count].Substring(0, 12);
            for (int i = 0; i < dialogs[dia_count].Length - 12; i++)
            {
                /*scroll = false;
                 *
                 * leftText.text = dialogs[dia_count].Substring(i + 1, 12);*/
                dia.Add(dialogs[dia_count].Substring(i + 1, 12));
            }
            StartCoroutine(BubbleOut());
        }
        else
        {
            leftText.text = dialogs[dia_count];
        }

        tp = Talking_person.LEFT;
    }