Esempio n. 1
0
    private void CreateGrounpList <T>(List <T> datas, int type = 0) where T : ModelBase
    {
        listMsg = _room.GetComponentInChildren <ListMsg>();

        roomList = datas as List <Room>;
        listMsg.Clear();
        int i = 0;

        ListData.SetRoomListData(roomList);
        datas.ForEach((item) => {
            bool isSeleced = false;
            if (i == 0)
            {
                isSeleced = true;
            }

            GameObject newObject = listMsg.Create(item.id.ToString(), item.name, isSeleced);
            if ((item as Room).runState == 0)
            {
                listMsg.SetGrountp(newObject, (item as Room).userCount, true, (item as Room).isCurrentUser);
            }
            else
            {
                listMsg.SetGrountp(newObject, (item as Room).userCount, false, (item as Room).isCurrentUser);
            }

            i++;
        });
    }
Esempio n. 2
0
    private void CreateUserList <T>(List <T> datas, int type) where T : ModelBase
    {
        listMsg = userList.GetComponentInChildren <ListMsg>();
        listMsg.Clear();
        int i = 0;

        datas.ForEach((item) => {
            GameObject newObject = null;
            if (i == 0)
            {
                newObject = listMsg.Create(item.id.ToString(), item.name, true);
            }
            else
            {
                newObject = listMsg.Create(item.id.ToString(), item.name, false);
            }
            listMsg.SetUser(newObject, item as UserItem);
            i++;
        });
    }