public IEnumerator ShowDialog()
    {
        List <ChatContents> chatList = GameModels.GetChatList("ChatContentList").ChatContentList;

        for (int i = 0; i < chatList.Count; i++)
        {
            if (chatList[i].teller == "1")//对方信息
            {
                GameObject go = Instantiate(mysteryMen) as GameObject;
                go.transform.parent        = transform;
                go.transform.localPosition = new Vector3(-590f, 180 - int.Parse(chatList[i].id) * 100 + 100);
                go.GetComponent <ChatContent>().SetContent(chatList[i].headImg, chatList[i].content);
                yield return(new WaitForSeconds(1f));

                Write(chatList[i + 1].content);
                yield return(new WaitForSeconds(3.5f));
            }
            else if (chatList[i].teller == "0")//自己的信息
            {
                GameObject go = Instantiate(mogutou) as GameObject;
                go.transform.parent        = transform;
                go.transform.localPosition = new Vector3(560f, 180 - int.Parse(chatList[i].id) * 100 + 100);
                go.GetComponent <ChatContent>().SetContent(chatList[i].headImg, chatList[i].content);
                yield return(new WaitForSeconds(2.5f));
            }
        }
        Mgr._instance.SetBtnVisible(true);
    }
Exemplo n.º 2
0
    void ShowNarratage()
    {
        List <ChatContents> openNarratage = GameModels.GetChatList("ChatContentList").OpenAnim;

        narratageText.DOText(DealStr(openNarratage[0].content), 5f).SetEase(Ease.Linear).OnComplete(() =>
        {
            img.sprite = Resources.Load <Sprite>(VariablePath.Image_OpenAnim + openNarratage[0].headImg);
            img.DOFade(1, 2f).OnComplete(() => { Mgr._instance.SetBtnVisible(true); });
        });
    }