void updateRoomList() { if (roomDataList != null && roomDataList.Count > 0) { int currentCount = current * Common.LIST_COUNT; if (currentCount > maxCount) { currentCount = maxCount; } bottomNaviText.text = currentCount + "/" + maxCount; for (int i = 0; i < Common.LIST_COUNT; i++) { if (i < roomDataList.Count) { listItem[i].SetActive(true); ResponseRoomList.Room room = roomDataList[i]; listItem[i].GetComponent <RoomItem>().setData(room); } else { listItem[i].SetActive(false); } } } else { //목록없음 } }
public void setData(ResponseRoomList.Room roomInfo) { this.roomInfo = roomInfo; txtTitle.text = this.roomInfo.title; txtUserCount.text = this.roomInfo.maxUser + ""; //this.roomInfo.currentUser + "/" + this.roomInfo.maxUser; txtMasterNickName.text = roomInfo.masterUserNickName; }
public void onClick(ResponseRoomList.Room item) { //Debug.Log("" + item.getIndex()); Debug.Log("index : " + item.title); if (item.password == null || item.password.Length == 0) { RequestConnectionRoom req = new RequestConnectionRoom(item.no, UserManager.Instance().nickName, (int)Common.USER_TYPE.USER); SocketManager.Instance().sendMessage(req); } else { // GameManager.Instance ().showAlert ("비밀번호를 입력해주세요.", true, (bool result, string fieldText) => { // if(result){ // RequestRoomPassword req = new RequestRoomPassword(item.no, fieldText); // SocketManager.Instance().sendMessage(req); // }else{ // } // }, true); showAlert("connectPasswd", "비밀번호를 입력해주세요.", true, true, (AlertData data, bool isOn, string fieldText) => { if (isOn) { //RequestRoomPassword req = new RequestRoomPassword(item.no, fieldText); //SocketManager.Instance().sendMessage(req); if (fieldText.Equals(item.password)) { RequestConnectionRoom req = new RequestConnectionRoom(item.no, UserManager.Instance().nickName, (int)Common.USER_TYPE.USER); SocketManager.Instance().sendMessage(req); } else { showAlert("failPasswd", "비밀번호가 다릅니다.", false, false, (AlertData data1, bool isOn1, string fieldText1) => { }); } } }); } }