Exemple #1
0
 public ChatCellStruct(UIMessageChatCell _cell, SockWorldChatData _data, ChatCellType _celltype, int _index)
 {
     _UIMessageChatCell = _cell;
     _SockWorldChatData = _data;
     _ChatCellType      = _celltype;
     _IndexLabel        = _index;
 }
Exemple #2
0
    public void OnShow(SockWorldChatData data, ChatCellType _type)
    {
        m_type = _type;
        gid    = data.roleid;
        if (_type == ChatCellType.ChatCellType_NORMAL)
        {
            mNormalType.gameObject.SetActive(true);
            mVideoType.gameObject.SetActive(false);
            int m_hight = mNormalDis.height;

            mName.text = data.roleName;
            mNormalDis.SetText(data.content);
            mLevel.text = data.rolelv.ToString();

            BgBig.height   = BgBig.height + mNormalDis.height - m_hight;
            BgSmall.height = BgSmall.height + mNormalDis.height - m_hight;

            BoxCollider box1 = this.gameObject.GetComponent <BoxCollider>();
            box1.size   = new Vector3(BgBig.width, BgBig.height, 0f);
            box1.center = new Vector3(0, -(mNormalDis.height - m_hight) / 2, 0f);
        }
        else
        {
            mNormalType.gameObject.SetActive(false);
            mVideoType.gameObject.SetActive(true);
//			mVideoDis.gameObject.SetActive(false);

            int m_hight = mVideoDis.height;

            mName.text = data.roleName;
            mVideoDis.SetText(data.content);
            mLevel.text = data.rolelv.ToString();

            BgBig.height   = BgBig.height + mVideoDis.height - m_hight;
            BgSmall.height = BgSmall.height + mVideoDis.height - m_hight;

            BoxCollider box1 = this.gameObject.GetComponent <BoxCollider>();
            box1.size   = new Vector3(BgBig.width, BgBig.height, 0f);
            box1.center = new Vector3(0, -(mVideoDis.height - m_hight) / 2, 0f);

            AnalysisString(data.content);
        }



        if (data.iconid == 0)
        {
            AtlasMgr.mInstance.SetHeadSprite(mHead, "10104");
        }
        else
        {
            AtlasMgr.mInstance.SetHeadSprite(mHead, data.iconid.ToString());
        }


        DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
        long     lTime   = data.time * 10000;
//		TimeSpan toNow = new TimeSpan(lTime+dtStart.Ticks);
        DateTime dt = new DateTime(lTime + dtStart.Ticks);

//		long time_JAVA_Long = data.time;//java长整型日期,毫秒为单位
//		DateTime dt_1970 = new DateTime(1970,1,1);
//		long tricks_1970 = dt_1970.Ticks;//1970年1月1日刻度
//		long time_tricks = tricks_1970 + time_JAVA_Long*10000;//日志日期刻度
//		DateTime dt = new DateTime(time_tricks);//转化为DateTime

        mTime.text = dt.Year + "/" + dt.Month + "/" + dt.Day + " " + dt.Hour + ":" + dt.Minute + ":" + dt.Second;
    }