void ChangeLanguage()
    {
        Text text = this.gameObject.GetComponent <Text>();

        if (text != null)
        {
            var value = LanguageControl.GetValue(LangKey).Replace("\\n", "\n");
            text.text = value;
        }
    }
示例#2
0
    IEnumerator TypeSentence(DialogueDetail detail)
    {
        if (detail.needSelection)
        {
            Contiune.gameObject.SetActive(false);
        }
        else
        {
            Contiune.gameObject.SetActive(true);
        }
        DialogueText.text = "";
        string sentence = LanguageControl.GetValue(detail.key);

        foreach (char letter in sentence.ToCharArray())
        {
            DialogueText.text += letter;
            yield return(new WaitForSeconds(0.05f));
        }

        if (detail.needSelection)
        {
            animator.SetBool("ShowChoice", true);
            choice1.SetText(detail.choice1);
            choice1.name = detail.targetID1.ToString();
            choice2.SetText(detail.choice2);
            choice2.name = detail.targetID2.ToString();
        }

        switch (detail.key)//为了关闭phone call按钮
        {
        case "reporter7":
        case "bmf4":
            SendEvent(Const.E_DialogEnd);
            break;
        }
    }