示例#1
0
    public void LoadChat()
    {
        if (talkManager.getId(id1) != 0)
        {
            questTalkIndex = PlayerPrefs.GetInt("QuestActionIndex");
            for (int i = 0; i < questTalkIndex; i++)
            {
                talkManager.getTalk(id1);
            }
            int isgame = PlayerPrefs.GetInt("IsGame");
            if (isgame == 2)
            {
                talkManager.getTalk(id1);
            }
        }

        TalkLog talkLog = new TalkLog("");

        string data = talkManager.getTalkLog(id1);

        JsonUtility.FromJsonOverwrite(data, talkLog);

        foreach (string str in talkLog.log)
        {
            string[] s = str.Split(':');
            if (s.Length == 1)
            {
                talkManager.ChangeDate();
            }
            else
            {
                talkManager.Chat(Convert.ToBoolean(s[1]), s[0]);
            }
        }

        if (talkManager.getAnswer(id1 + questTalkIndex).Count != 0)
        {
            answer1.text = talkManager.getAnswer(id1 + questTalkIndex)[0].ToString();
            answer2.text = talkManager.getAnswer(id1 + questTalkIndex)[1].ToString();
            selectPanel.SetActive(true);
            isSelect = true;
        }
    }