Exemple #1
0
        public void SetMessageData(List <MessageItemData> listData)
        {
            if (listData == null)
            {
                return;
            }

            LTUIUtil.SetNumTemplate(templatedynamic, listItem, listData.Count, 0);

            for (int i = 0; i < listMessageItem.Count; i++)
            {
                if (i > listData.Count - 1)
                {
                    listMessageItem[i].mDMono.gameObject.CustomSetActive(false);
                    continue;
                }
                listMessageItem[i].mDMono.gameObject.CustomSetActive(true);
                listMessageItem[i].titleDayLabel.text = string.Format("{0}.{1}.{2}", listData[i].year, listData[i].month, listData[i].day);
                for (int j = 0; j < listData[i].listCell.Count; j++)
                {
                    MessageCellData cell = listData[i].listCell[j];

                    if (j == 0)
                    {
                        listMessageItem[i].contentLabel.text = cell.content == null ? "" : cell.content;
                    }
                    else
                    {
                        if (cell.content == null)
                        {
                            listMessageItem[i].contentLabel.text += "";
                        }
                        else
                        {
                            listMessageItem[i].contentLabel.text += "\n" + cell.content;
                        }
                    }
                }

                if (i > 0)
                {
                    listMessageItem[i].mDMono.transform.localPosition = listMessageItem[i - 1].mDMono.transform.localPosition
                                                                        - new Vector3(0f, listMessageItem[i - 1].GetHeight(), 0f);
                }
            }
        }
Exemple #2
0
        public override void SetMenuData(object param)
        {
            List <GhostReward> tabl = param as List <GhostReward>;

            if (listItem.Count != tabl.Count)
            {
                LTUIUtil.SetNumTemplate <Transform>(_listTrans[0], _listTrans, tabl.Count, behind);

                if (_listTrans.Count > listItem.Count)
                {
                    while (_listTrans.Count != listItem.Count)
                    {
                        Transform item = _listTrans[listItem.Count];
                        tempdata = new LTSpeedSnatchAwardItem(item);
                        listItem.Add(tempdata);
                    }
                }
                else
                {
                    while (_listTrans.Count != listItem.Count)
                    {
                        listItem.RemoveAt(_listTrans.Count - 1);
                    }
                }
            }

            for (int i = 0; i < tabl.Count; i++)
            {
                LTSpeedSnatchAwardItem item = listItem[i];
                item.spt001.spriteName = tabl[i].spriteNames[0];
                item.spt002.spriteName = tabl[i].spriteNames[1];
                item.spt003.spriteName = tabl[i].spriteNames[2];

                item.showItem.LTItemData = tabl[i].rewards[0]; // new ShowItemData(tabl[i].reward, 1, UIGameItem.TYPE_GAMINVENTORY);

                if (i == tabl.Count - 1)                       //最后一组改成文字提示
                {
                    item.otherTipsLabel.gameObject.SetActive(true);
                    item.showAttrTrans.gameObject.SetActive(false);
                }
            }
        }