Beispiel #1
0
    /// <summary>
    /// 加入文字履历
    /// </summary>
    /// <param name="bt"></param>
    private void AddToTable(BacklogText bt)
    {
        //获取系统数据储存的数目
        Queue <BacklogText> history = DataManager.GetInstance().GetHistory();

        if (history.Count == 0)
        {
            table.transform.DestroyChildren();
        }
        //添加U最新一行界面
        GameObject go = Resources.Load("Prefab/Backlog") as GameObject;

        go = NGUITools.AddChild(table, go);
        //绑定数据
        go.transform.Find("Avatar_Sprite").GetComponent <UI2DSprite>().sprite2D             = null;
        go.transform.Find("NameBack_Sprite/Name_Label").GetComponent <UILabel>().text       = bt.charaName;
        go.transform.Find("ContentBack_Sprite/Content_Label").GetComponent <UILabel>().text = bt.mainContent;
        if (!string.IsNullOrEmpty(bt.voicePath))
        {
            GameObject vb = go.transform.Find("Voice_Button").gameObject;
            vb.SetActive(true);
            vb.GetComponent <BacklogVoiceButton>().path = bt.voicePath;
        }
        if (table.transform.childCount > 100)
        {
            //删除第一个
            Destroy(table.transform.GetChild(0).gameObject);
        }
        DataManager.GetInstance().AddHistory(bt);
    }
        /// <summary>
        /// 添加文字记录
        /// </summary>
        /// <param name="blt">文本记录块</param>
        public void AddHistory(BacklogText blt)
        {
            Queue <BacklogText> history = GetTempVar <Queue <BacklogText> >("文字记录");

            if (history.Count > 100)
            {
                history.Dequeue();
            }
            history.Enqueue(blt);
        }
Beispiel #3
0
        /// <summary>
        /// 添加文字记录
        /// </summary>
        /// <param name="blt">文本记录块</param>
        public void AddHistory(BacklogText blt)
        {
            Queue <BacklogText> history = tempData.backLog;

            if (history.Count > 100)
            {
                history.Dequeue();
            }
            history.Enqueue(blt);
        }